Commit-ID: cf5b15bf05d416deb6c0bf39bfb634cf5a511b64 Gitweb: http://git.kernel.org/tip/cf5b15bf05d416deb6c0bf39bfb634cf5a511b64 Author: Thomas Gleixner <tglx@xxxxxxxxxxxxx> AuthorDate: Fri, 7 Oct 2016 14:02:12 +0200 Committer: Thomas Gleixner <tglx@xxxxxxxxxxxxx> CommitDate: Sat, 8 Oct 2016 12:07:25 +0200 x86/acpi: Prevent LAPIC id 0xff from being accounted 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 <yinghai@xxxxxxxxxx> Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Cc: Gu Zheng <guz.fnst@xxxxxxxxxxxxxx>, Cc: Tang Chen <tangchen@xxxxxxxxxxxxxx> Cc: douly.fnst@xxxxxxxxxxxxxx, Cc: zhugh.fnst@xxxxxxxxxxxxxx Cc: Tony Luck <tony.luck@xxxxxxxxx> Cc: Rafael J. Wysocki <rjw@xxxxxxxxxxxxx> Cc: Len Brown <lenb@xxxxxxxxxx> Cc: Lv Zheng <lv.zheng@xxxxxxxxx>, Cc: robert.moore@xxxxxxxxx Cc: linux-acpi@xxxxxxxxxxxxxxx Link: https://lkml.kernel.org/r/CAE9FiQVQx6FRXT-RdR7Crz4dg5LeUWHcUSy1KacjR+JgU_vGJg@xxxxxxxxxxxxxx --- arch/x86/kernel/acpi/boot.c | 4 ++++ arch/x86/kernel/apic/apic.c | 8 +++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 32a7d70..8a5abaa 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c @@ -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 diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index f266b8a..dc9ec12 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -2128,9 +2128,11 @@ int __generic_processor_info(int apicid, int version, bool enabled) if (num_processors >= nr_cpu_ids) { int thiscpu = max + disabled_cpus; - pr_warning( - "APIC: NR_CPUS/possible_cpus limit of %i reached." - " Processor %d/0x%x ignored.\n", max, thiscpu, apicid); + if (enabled) { + pr_warn_once("APIC: NR_CPUS/possible_cpus limit of %i " + "reached. Processor %d/0x%x ignored.\n", + max, thiscpu, apicid); + } disabled_cpus++; return -EINVAL; -- To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
![]() |