Skip to content

Commit aa06e20

Browse files
superm1rafaeljw
authored andcommitted
x86/ACPI: Don't add CPUs that are not online capable
A number of systems are showing "hotplug capable" CPUs when they are not really hotpluggable. This is because the MADT has extra CPU entries to support different CPUs that may be inserted into the socket with different numbers of cores. Starting with ACPI 6.3 the spec has an Online Capable bit in the MADT used to determine whether or not a CPU is hotplug capable when the enabled bit is not set. Link: https://uefi.org/htmlspecs/ACPI_Spec_6_4_html/05_ACPI_Software_Programming_Model/ACPI_Software_Programming_Model.html?#local-apic-flags Signed-off-by: Mario Limonciello <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 435a8dc commit aa06e20

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

arch/x86/kernel/acpi/boot.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ int acpi_fix_pin2_polarity __initdata;
6262

6363
#ifdef CONFIG_X86_LOCAL_APIC
6464
static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE;
65+
static bool acpi_support_online_capable;
6566
#endif
6667

6768
#ifdef CONFIG_X86_IO_APIC
@@ -138,6 +139,8 @@ static int __init acpi_parse_madt(struct acpi_table_header *table)
138139

139140
pr_debug("Local APIC address 0x%08x\n", madt->address);
140141
}
142+
if (madt->header.revision >= 5)
143+
acpi_support_online_capable = true;
141144

142145
default_acpi_madt_oem_check(madt->header.oem_id,
143146
madt->header.oem_table_id);
@@ -239,6 +242,12 @@ acpi_parse_lapic(union acpi_subtable_headers * header, const unsigned long end)
239242
if (processor->id == 0xff)
240243
return 0;
241244

245+
/* don't register processors that can not be onlined */
246+
if (acpi_support_online_capable &&
247+
!(processor->lapic_flags & ACPI_MADT_ENABLED) &&
248+
!(processor->lapic_flags & ACPI_MADT_ONLINE_CAPABLE))
249+
return 0;
250+
242251
/*
243252
* We need to register disabled CPU as well to permit
244253
* counting disabled CPUs. This allows us to size

0 commit comments

Comments
 (0)