From: Elliott Mitchell <ehem+xen@m5p.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: Neowutran <xen@neowutran.ovh>,
xen-devel@lists.xenproject.org,
Andrew Cooper <andrew.cooper3@citrix.com>,
George Dunlap <george.dunlap@citrix.com>,
Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>,
Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>
Subject: Re: [PATCH] x86/x2apic: introduce a mixed physical/cluster mode
Date: Tue, 31 Oct 2023 18:05:20 -0700 [thread overview]
Message-ID: <ZUGkUEvWwaOPMuYP@mattapan.m5p.com> (raw)
In-Reply-To: <ZT_LWjKgQxOE9lpj@macbook>
On Mon, Oct 30, 2023 at 04:27:22PM +0100, Roger Pau Monné wrote:
> On Mon, Oct 30, 2023 at 07:50:27AM -0700, Elliott Mitchell wrote:
> > On Tue, Oct 24, 2023 at 03:51:50PM +0200, Roger Pau Monne wrote:
> > > diff --git a/xen/arch/x86/genapic/x2apic.c b/xen/arch/x86/genapic/x2apic.c
> > > index 707deef98c27..15632cc7332e 100644
> > > --- a/xen/arch/x86/genapic/x2apic.c
> > > +++ b/xen/arch/x86/genapic/x2apic.c
> > > @@ -220,38 +239,56 @@ static struct notifier_block x2apic_cpu_nfb = {
> > > static int8_t __initdata x2apic_phys = -1;
> > > boolean_param("x2apic_phys", x2apic_phys);
> > >
> > > +enum {
> > > + unset, physical, cluster, mixed
> > > +} static __initdata x2apic_mode = unset;
> > > +
> > > +static int __init parse_x2apic_mode(const char *s)
> > > +{
> > > + if ( !cmdline_strcmp(s, "physical") )
> > > + x2apic_mode = physical;
> > > + else if ( !cmdline_strcmp(s, "cluster") )
> > > + x2apic_mode = cluster;
> > > + else if ( !cmdline_strcmp(s, "mixed") )
> > > + x2apic_mode = mixed;
> > > + else
> > > + return EINVAL;
> > > +
> > > + return 0;
> > > +}
> > > +custom_param("x2apic-mode", parse_x2apic_mode);
> > > +
> > > const struct genapic *__init apic_x2apic_probe(void)
> > > {
> > > - if ( x2apic_phys < 0 )
> > > + /* x2apic-mode option has preference over x2apic_phys. */
> > > + if ( x2apic_phys >= 0 && x2apic_mode == unset )
> > > + x2apic_mode = x2apic_phys ? physical : cluster;
> > > +
> > > + if ( x2apic_mode == unset )
> > > {
> > > - /*
> > > - * Force physical mode if there's no (full) interrupt remapping support:
> > > - * The ID in clustered mode requires a 32 bit destination field due to
> > > - * the usage of the high 16 bits to hold the cluster ID.
> > > - */
> > > - x2apic_phys = iommu_intremap != iommu_intremap_full ||
> > > - (acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL) ||
> > > - IS_ENABLED(CONFIG_X2APIC_PHYSICAL);
> > > - }
> > > - else if ( !x2apic_phys )
> > > - switch ( iommu_intremap )
> > > + if ( acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL )
> > > {
> >
> > Could this explain the issues with recent AMD processors/motherboards?
> >
> > Mainly the firmware had been setting this flag, but Xen was previously
> > ignoring it?
>
> No, not unless you pass {no-}x2apic_phys={false,0} on the Xen command
> line to force logical (clustered) destination mode.
>
> > As such Xen had been attempting to use cluster mode on an
> > x2APIC where that mode was broken for physical interrupts?
>
> No, not realy, x2apic_phys was already forced to true if
> acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL is set on the FADT (I
> just delete that line in this same chunk and move it here).
I think I inverted the case in my speculation. Perhaps AMD's firmware
SHOULD have been setting ACPI_FADT_APIC_PHYSICAL, but failed to?
Given the rough launch with AMD's latest, I could readily see there
being a goof like this. Question will then be, will mixed mode work on
these processors?
--
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/)
\BS ( | ehem+sigmsg@m5p.com PGP 87145445 | ) /
\_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
next prev parent reply other threads:[~2023-11-01 1:06 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-24 13:51 [PATCH] x86/x2apic: introduce a mixed physical/cluster mode Roger Pau Monne
2023-10-30 14:32 ` Jan Beulich
2023-10-30 16:10 ` Roger Pau Monné
2023-10-30 16:34 ` Jan Beulich
2023-10-30 16:38 ` Roger Pau Monné
2023-10-30 14:50 ` Elliott Mitchell
2023-10-30 15:27 ` Roger Pau Monné
2023-11-01 1:05 ` Elliott Mitchell [this message]
2023-11-07 19:35 ` Elliott Mitchell
2023-11-17 10:12 ` Neowutran
2023-11-18 3:04 ` Elliott Mitchell
2023-11-18 11:33 ` Andrew Cooper
2023-11-22 0:56 ` Elliott Mitchell
2023-11-23 9:39 ` Roger Pau Monné
2023-11-25 1:15 ` Elliott Mitchell
2023-11-27 8:27 ` Roger Pau Monné
2023-12-04 1:02 ` Elliott Mitchell
2023-12-04 8:03 ` Jan Beulich
2023-12-04 11:07 ` Roger Pau Monné
2023-11-24 19:54 ` Neowutran
2023-11-27 11:49 ` Andrew Cooper
2023-11-27 14:53 ` Roger Pau Monné
2023-11-27 15:56 ` Andrew Cooper
2023-11-27 15:18 ` Neowutran
2023-11-27 16:17 ` Andrew Cooper
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=ZUGkUEvWwaOPMuYP@mattapan.m5p.com \
--to=ehem+xen@m5p.com \
--cc=andrew.cooper3@citrix.com \
--cc=george.dunlap@citrix.com \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=wl@xen.org \
--cc=xen-devel@lists.xenproject.org \
--cc=xen@neowutran.ovh \
/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.