linux/arch/x86/kernel/acpi
Thomas Gleixner d5a10b976e x86/acpi: Handle bogus MADT APIC tables gracefully
The recent fix to ignore invalid x2APIC entries inadvertently broke
systems with creative MADT APIC tables. The affected systems have APIC
MADT tables where all entries have invalid APIC IDs (0xFF), which means
they register exactly zero CPUs.

But the condition to ignore the entries of APIC IDs < 255 in the X2APIC
MADT table is solely based on the count of MADT APIC table entries.

As a consequence, the affected machines enumerate no secondary CPUs at
all because the APIC table has entries and therefore the X2APIC table
entries with APIC IDs < 255 are ignored.

Change the condition so that the APIC table preference for APIC IDs <
255 only becomes effective when the APIC table has valid APIC ID
entries.

IOW, an APIC table full of invalid APIC IDs is considered to be empty
which in consequence enables the X2APIC table entries with a APIC ID
< 255 and restores the expected behaviour.

Fixes: ec9aedb2aa ("x86/acpi: Ignore invalid x2APIC entries")
Reported-by: John Sperbeck <jsperbeck@google.com>
Reported-by: Andres Freund <andres@anarazel.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/169953729188.3135.6804572126118798018.tip-bot2@tip-bot2
2023-12-18 14:21:44 +01:00
..
apei.c x86/mce, cper: Pass x86 CPER through the MCA handling chain 2020-11-21 12:05:41 +01:00
boot.c x86/acpi: Handle bogus MADT APIC tables gracefully 2023-12-18 14:21:44 +01:00
cppc.c ACPI: CPPC: Fix enabling CPPC on AMD systems with shared memory 2022-07-13 21:13:14 +02:00
cstate.c x86/acpi/cstate: Optimize ARB_DISABLE on Centaur CPUs 2022-11-11 09:42:05 -08:00
Makefile x86/ACPI: CPPC: Rename cppc_msr.c to cppc.c 2022-03-08 19:16:43 +01:00
sleep.c x86/smpboot: Support parallel startup of secondary CPUs 2023-05-15 13:45:04 +02:00
sleep.h x86/acpi: Remove unused extern declaration acpi_copy_wakeup_routine() 2023-06-21 10:57:54 -07:00
wakeup_32.S x86: Prepare asm files for straight-line-speculation 2021-12-08 12:25:37 +01:00
wakeup_64.S kasan: remove redundant config option 2021-04-16 16:10:36 -07:00