From: Thomas Gleixner <tglx@linutronix.de>
To: "Roger Pau Monné" <roger.pau@citrix.com>,
"Jan Beulich" <jbeulich@suse.com>,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Simon Gaiser" <simon@invisiblethingslab.com>
Cc: "Wei Liu" <wl@xen.org>,
"Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>,
xen-devel@lists.xenproject.org
Subject: Re: [XEN PATCH] x86/ACPI: Ignore entries with invalid APIC IDs when parsing MADT
Date: Wed, 30 Aug 2023 00:54:21 +0200 [thread overview]
Message-ID: <874jkh7942.ffs@tglx> (raw)
In-Reply-To: <ZO3_0GKvEk-qoaoa@MacBook-Air-de-Roger.local>
On Tue, Aug 29 2023 at 16:25, Roger Pau Monné wrote:
> On Sun, Aug 27, 2023 at 05:44:15PM +0200, Thomas Gleixner wrote:
>> The APIC/X2APIC description of MADT specifies flags:
>>
>> Enabled If this bit is set the processor is ready for use. If
>> this bit is clear and the Online Capable bit is set,
>> system hardware supports enabling this processor during
>> OS runtime. If this bit is clear and the Online Capable
>> bit is also clear, this processor is unusable, and OSPM
>> shall ignore the contents of the Processor Local APIC
>> Structure.
>>
>> Online Capable The information conveyed by this bit depends on the
>> value of the Enabled bit. If the Enabled bit is set,
>> this bit is reserved and must be zero. Otherwise, if
>> this this bit is set, system hardware supports enabling
>> this processor during OS runtime.
>
> Sadly this flag is only present starting with MADT v5.
Correct. The difference between pre v5 MADT and v5+ is that the latter
allows the OS to make more informed decisions, but the lack of this flag
does not make the claim that randomly assigning APIC IDs after the
initial parsing is a valid approach any more correct. Why?
Simply because the other relationships vs. processor UIDs and SRAT/SLIT
are not magically going away due to the lack of that flag.
>> Otherwise you'd end up with a CPU hotplugged which is outside of the
>> resource space allocated during init.
>
> It's my understating that ACPI UIDs 0xff and 0xfffffff for local ACPI
> and x2APIC structures respectively are invalid, as that's the
> broadcast value used by the local (x2)APIC NMI Structures.
Correct. These IDs are invalid independent of any flag value.
> I think Jan's point (if I understood correctly) is that Processor or
> Device objects can have a _MAT method that returns updated MADT
> entries, and some ACPI implementations might modify the original
> entries on the MADT and return them from that method when CPU
> hotplug takes place. The spec notes that "OSPM does not expect the
> information provided in this table to be updated if the processor
> information changes during the lifespan of an OS boot." so that the
> MADT doesn't need to be updated when CPU hotplug happens, but I don't
> see that sentence as preventing the MADT to be updated if CPU hotplug
> takes place, it's just not required.
Right. But if you read carefully what I wrote then you will figure out
that any randomly made up APIC ID post MADT enumeration cannot work.
> I don't see anywhere in the spec that states that APIC IDs 0xff and
> 0xffffffff are invalid and entries using those IDs should be ignored,
> but I do think that any system that supports CPU hotplug better has
> those IDs defined since boot. Also it seems vendors have started
> relying on using 0xff and 0xffffffff APIC IDs to signal non-present
> CPUs, and Linux has been ignoring such entries for quite some time
> already without reported issues.
There is no requirement for the ACPI spec to state this simply because
these APIC IDs are invalid to address a processor at the architectural
level. ACPI does not care about architectural restrictions unless really
required, e.g. like the LAPIC vs. X2APIC exclusiveness.
Thanks,
tglx
next prev parent reply other threads:[~2023-08-29 22:54 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-07 9:38 [XEN PATCH] x86/ACPI: Ignore entries with invalid APIC IDs when parsing MADT Simon Gaiser
2023-08-07 10:01 ` Andrew Cooper
2023-08-07 10:06 ` Andrew Cooper
2023-08-07 10:17 ` Simon Gaiser
2023-08-07 14:45 ` Simon Gaiser
2023-08-23 9:32 ` Andrew Cooper
2023-09-11 10:17 ` Simon Gaiser
2023-08-07 10:13 ` Jan Beulich
2023-08-07 12:55 ` Simon Gaiser
2023-08-07 13:17 ` Jan Beulich
2023-08-07 14:04 ` Andrew Cooper
2023-08-07 14:18 ` Jan Beulich
2023-08-23 9:21 ` Andrew Cooper
2023-08-23 12:56 ` Jan Beulich
2023-08-27 15:44 ` Thomas Gleixner
2023-08-29 14:25 ` Roger Pau Monné
2023-08-29 22:54 ` Thomas Gleixner [this message]
2023-08-30 7:20 ` Jan Beulich
2023-08-30 15:44 ` Thomas Gleixner
2023-08-07 15:05 ` Simon Gaiser
2023-08-23 9:13 ` Roger Pau Monné
2023-09-01 7:44 ` Jan Beulich
2023-09-06 20:49 ` Stefano Stabellini
2023-09-07 6:50 ` Jan Beulich
2023-09-07 21:30 ` Stefano Stabellini
2023-09-11 18:24 ` Andrew Cooper
2023-09-11 22:38 ` Stefano Stabellini
2023-09-12 9:38 ` Roger Pau Monné
2023-09-12 7:56 ` Thomas Gleixner
2023-09-13 10:02 ` George Dunlap
2023-09-13 23:18 ` Stefano Stabellini
2023-09-15 10:41 ` George Dunlap
2023-09-12 8:33 ` Jan Beulich
2023-09-12 8:36 ` Jan Beulich
2023-09-11 18:05 ` Simon Gaiser
2023-09-12 8:41 ` Jan Beulich
2023-09-12 8:45 ` 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=874jkh7942.ffs@tglx \
--to=tglx@linutronix.de \
--cc=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=marmarek@invisiblethingslab.com \
--cc=roger.pau@citrix.com \
--cc=simon@invisiblethingslab.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.