x86/acpi: Prevent LAPIC id 0xff from being accounted
authorThomas Gleixner <[email protected]>
Fri, 7 Oct 2016 12:02:12 +0000 (14:02 +0200)
committerThomas Gleixner <[email protected]>
Sat, 8 Oct 2016 10:10:52 +0000 (12:10 +0200)
Yinghai reported that the recent changes to make the cpuid - nodeid
relationship permanent causes a cpuid ordering regression on a system which
has 2apic enabled..

The reason is that the ACPI local APIC parser has no sanity check for
apicid 0xff, which is an invalid id. So a CPU id for this invalid local
APIC id is allocated and therefor breaks the cpuid ordering.

Add a sanity check to acpi_parse_lapic() which ignores the invalid id.

Fixes: 8f54969dc8d6 ("x86/acpi: Introduce persistent storage for cpuid <-> apicid mapping")
Reported-by: Yinghai Lu <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Cc: Gu Zheng <[email protected]>,
Cc: Tang Chen <[email protected]>
Cc: [email protected],
Cc: [email protected]
Cc: Tony Luck <[email protected]>
Cc: Rafael J. Wysocki <[email protected]>
Cc: Len Brown <[email protected]>
Cc: Lv Zheng <[email protected]>,
Cc: [email protected]
Cc: [email protected]
Link: https://lkml.kernel.org/r/CAE9FiQVQx6FRXT-RdR7Crz4dg5LeUWHcUSy1KacjR+JgU_vGJg@mail.gmail.com
arch/x86/kernel/acpi/boot.c

index 32a7d70913acb7bd73ab83cccf66295ea5da9af3..8a5abaa7d4533e1592bc6977569c737762089516 100644 (file)
@@ -233,6 +233,10 @@ acpi_parse_lapic(struct acpi_subtable_header * header, const unsigned long end)
 
        acpi_table_print_madt_entry(header);
 
+       /* Ignore invalid ID */
+       if (processor->id == 0xff)
+               return 0;
+
        /*
         * We need to register disabled CPU as well to permit
         * counting disabled CPUs. This allows us to size