qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] ACPI: i386: bump MADT to revision 3
@ 2023-05-15 20:33 Eric DeVolder
  2023-05-15 20:33 ` [PATCH 1/3] ACPI: bios-tables-test.c step 2 (allowed-diff entries) Eric DeVolder
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Eric DeVolder @ 2023-05-15 20:33 UTC (permalink / raw)
  To: qemu-devel, shannon.zhaosl, mst, imammedo, ani, peter.maydell,
	qemu-arm, marcel.apfelbaum, pbonzini, richard.henderson, eduardo
  Cc: boris.ostrovsky, miguel.luis, eric.devolder

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.

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



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-05-16 21:28 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-15 20:33 [PATCH 0/3] ACPI: i386: bump MADT to revision 3 Eric DeVolder
2023-05-15 20:33 ` [PATCH 1/3] ACPI: bios-tables-test.c step 2 (allowed-diff entries) Eric DeVolder
2023-05-16  7:25   ` Ani Sinha
2023-05-15 20:33 ` [PATCH 2/3] ACPI: i386: bump to MADT to revision 3 Eric DeVolder
2023-05-16  7:25   ` Ani Sinha
2023-05-16 12:31   ` Igor Mammedov
2023-05-16 12:51     ` Ani Sinha
2023-05-16 21:22       ` Eric DeVolder
2023-05-16 21:28         ` Michael S. Tsirkin
2023-05-15 20:33 ` [PATCH 3/3] ACPI: bios-tables-test.c step 5 (update expected table binaries) Eric DeVolder
2023-05-16  7:28   ` Ani Sinha
2023-05-16  7:39 ` [PATCH 0/3] ACPI: i386: bump MADT to revision 3 Ani Sinha

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).