On Tue, May 16, 2023 at 2:03 AM Eric DeVolder <eric.devolder@oracle.com> wrote:
>
> The following Linux kernel change broke CPU hotplug for MADT revision
> less than 5.
>
> e2869bd7af60 ("x86/acpi/boot: Do not register processors that cannot be onlined for x2APIC")
>
> Discussion on this topic can be located here:
>
> https://lore.kernel.org/linux-acpi/20230327191026.3454-1-eric.devolder@oracle.com/T/#t
>
> which resulted in the following fixes in Linux 6.3-rc5:
>
> a74fabfbd1b7: ("x86/ACPI/boot: Use FADT version to check support for online capable")
> fed8d8773b8e: ("x86/acpi/boot: Correct acpi_is_processor_usable() check")
>
> However, as part of the investigation into resolving this breakage, I
> learned that i386 QEMU reports revision 1, while technically it
> generates revision 3.
Since this series was sent to my personal email and not my redhat
email, I suspect you have not rebased your patchset. Maybe you should
do that in case it generates any conflicts etc.
>
> Below is a table summarizing the changes to the MADT. This information
> gleamed from the ACPI specs on uefi.org.
>
> ACPI MADT What
> Version Version
> 1.0 MADT not present
> 2.0 1 Section 5.2.10.4
> 3.0 2 Section 5.2.11.4
> 5.2.11.13 Local SAPIC Structure added two new fields:
> ACPI Processor UID Value
> ACPI Processor UID String
> 5.2.10.14 Platform Interrupt Sources Structure:
> Reserved changed to Platform Interrupt Sources Flags
> 3.0b 2 Section 5.2.11.4
> Added a section describing guidelines for the ordering of
> processors in the MADT to support proper boot processor
> and multi-threaded logical processor operation.
> 4.0 3 Section 5.2.12
> Adds Processor Local x2APIC structure type 9
> Adds Local x2APIC NMI structure type 0xA
> 5.0 3 Section 5.2.12
> 6.0 3 Section 5.2.12
> 6.0a 4 Section 5.2.12
> Adds ARM GIC structure types 0xB-0xF
> 6.2a 45 Section 5.2.12 <--- version 45, is indeed accurate!
> 6.2b 5 Section 5.2.12
> GIC ITS last Reserved offset changed to 16 from 20 (typo)
> 6.3 5 Section 5.2.12
> Adds Local APIC Flags Online Capable!
> Adds GICC SPE Overflow Interrupt field
> 6.4 5 Section 5.2.12
> Adds Multiprocessor Wakeup Structure type 0x10
> (change notes says structure previously misplaced?)
> 6.5 5 Section 5.2.12
>
> For the MADT revision change 1 -> 2, the spec has a change to the
> SAPIC structure. In general, QEMU does not generate/support SAPIC.
> So the QEMU i386 MADT revision can safely be moved to 2.
>
> For the MADT revision change 2 -> 3, the spec adds Local x2APIC
> structures. QEMU has long supported x2apic ACPI structures.
> So the QEMU i386 MADT revision can safely be moved to 3.
>
> So, set the MADT revision to 3.
>
> Regards,
> Eric
> ---
> Eric DeVolder (3):
> ACPI: bios-tables-test.c step 2 (allowed-diff entries)
> ACPI: i386: bump to MADT to revision 3
> ACPI: bios-tables-test.c step 5 (update expected table binaries)
>
> hw/i386/acpi-common.c | 2 +-
> tests/data/acpi/microvm/APIC | Bin 70 -> 70 bytes
> tests/data/acpi/microvm/APIC.ioapic2 | Bin 82 -> 82 bytes
> tests/data/acpi/microvm/APIC.pcie | Bin 110 -> 110 bytes
> tests/data/acpi/pc/APIC | Bin 120 -> 120 bytes
> tests/data/acpi/pc/APIC.acpihmat | Bin 128 -> 128 bytes
> tests/data/acpi/pc/APIC.cphp | Bin 160 -> 160 bytes
> tests/data/acpi/pc/APIC.dimmpxm | Bin 144 -> 144 bytes
> tests/data/acpi/q35/APIC | Bin 120 -> 120 bytes
> tests/data/acpi/q35/APIC.acpihmat | Bin 128 -> 128 bytes
> tests/data/acpi/q35/APIC.acpihmat-noinitiator | Bin 144 -> 144 bytes
> tests/data/acpi/q35/APIC.core-count2 | Bin 2478 -> 2478 bytes
> tests/data/acpi/q35/APIC.cphp | Bin 160 -> 160 bytes
> tests/data/acpi/q35/APIC.dimmpxm | Bin 144 -> 144 bytes
> tests/data/acpi/q35/APIC.xapic | Bin 2686 -> 2686 bytes
> 15 files changed, 1 insertion(+), 1 deletion(-)
>
> --
> 2.31.1
>