All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roger Pau Monne <roger.pau@citrix.com>
To: <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	Jan Beulich <jbeulich@suse.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH v2 2/4] x86/apic: force phys mode if interrupt remapping is disabled
Date: Fri, 29 Nov 2019 12:28:49 +0100	[thread overview]
Message-ID: <20191129112851.19273-3-roger.pau@citrix.com> (raw)
In-Reply-To: <20191129112851.19273-1-roger.pau@citrix.com>

Cluster mode can only be used with interrupt remapping support, since
the top 16bits of the APIC ID are filled with the cluster ID, and
hence on systems where the physical ID is still smaller than 255 the
cluster ID is not. Force x2APIC to use physical mode if there's no
interrupt remapping support.

Note that this requires a further patch in order to enable x2APIC
without interrupt remapping support.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Changes since v1:
 - New in this version.
---
 xen/arch/x86/genapic/x2apic.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/xen/arch/x86/genapic/x2apic.c b/xen/arch/x86/genapic/x2apic.c
index d5a17f10d5..7e32ee22ff 100644
--- a/xen/arch/x86/genapic/x2apic.c
+++ b/xen/arch/x86/genapic/x2apic.c
@@ -228,6 +228,14 @@ const struct genapic *__init apic_x2apic_probe(void)
     if ( x2apic_phys < 0 )
         x2apic_phys = !!(acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL);
 
+    if ( !x2apic_phys && !iommu_intremap )
+        /*
+         * Force physical mode if there's no interrupt remapping support: the
+         * ID in clustered mode requires a 32 bit destination field due to the
+         * usage of the high 16 bits to store the cluster ID.
+         */
+        x2apic_phys = true;
+
     if ( x2apic_phys )
         return &apic_x2apic_phys;
 
-- 
2.24.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2019-11-29 11:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-29 11:28 [Xen-devel] [PATCH v2 0/4] x86: enable x2APIC mode regardless of interrupt remapping support Roger Pau Monne
2019-11-29 11:28 ` [Xen-devel] [PATCH v2 1/4] x86/ioapic: only use dest32 with x2apic and interrupt remapping enabled Roger Pau Monne
2019-12-03 15:11   ` Jan Beulich
2019-12-04 10:47     ` Roger Pau Monné
2019-11-29 11:28 ` Roger Pau Monne [this message]
2019-11-29 11:38   ` [Xen-devel] [PATCH v2 2/4] x86/apic: force phys mode if interrupt remapping is disabled Roger Pau Monné
2019-12-03 15:14     ` Jan Beulich
2019-12-04  9:17       ` Roger Pau Monné
2019-12-04  9:34         ` Jan Beulich
2019-12-04 10:50           ` Roger Pau Monné
2019-11-29 11:28 ` [Xen-devel] [PATCH v2 3/4] x86/smp: check APIC ID on AP bringup Roger Pau Monne
2019-12-03 15:23   ` Jan Beulich
2019-11-29 11:28 ` [Xen-devel] [PATCH v2 4/4] x86/apic: allow enabling x2APIC mode regardless of interrupt remapping Roger Pau Monne
2019-12-03 15:33   ` Jan Beulich
2019-12-04 13:51     ` Roger Pau Monné
2019-12-04 14:28       ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191129112851.19273-3-roger.pau@citrix.com \
    --to=roger.pau@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.