Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965043AbcJHF0M (ORCPT ); Sat, 8 Oct 2016 01:26:12 -0400 Received: from mail-vk0-f65.google.com ([209.85.213.65]:35540 "EHLO mail-vk0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934857AbcJHF0K (ORCPT ); Sat, 8 Oct 2016 01:26:10 -0400 MIME-Version: 1.0 In-Reply-To: References: From: Yinghai Lu Date: Fri, 7 Oct 2016 22:26:08 -0700 X-Google-Sender-Auth: ZRyTIAGyNApfqDVNy3d7ja-uINw Message-ID: Subject: Re: [tip:x86/urgent] x86/acpi: Prevent LAPIC id 0xff from being accounted To: Tang Chen , Ingo Molnar , "H. Peter Anvin" , Tony Luck , Thomas Gleixner , Linux Kernel Mailing List , "Rafael J. Wysocki" , Len Brown , Yinghai Lu Cc: "linux-tip-commits@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2480 Lines: 65 On Fri, Oct 7, 2016 at 6:28 AM, tip-bot for Thomas Gleixner wrote: > Commit-ID: 8237bded3959c6d038798b905485d3ba94b8ea10 > Gitweb: http://git.kernel.org/tip/8237bded3959c6d038798b905485d3ba94b8ea10 > Author: Thomas Gleixner > AuthorDate: Fri, 7 Oct 2016 14:02:12 +0200 > Committer: Thomas Gleixner > CommitDate: Fri, 7 Oct 2016 15:22:15 +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 > Signed-off-by: Thomas Gleixner > Cc: Gu Zheng , > Cc: Tang Chen > Cc: douly.fnst@cn.fujitsu.com, > Cc: zhugh.fnst@cn.fujitsu.com > Cc: Tony Luck > Cc: Rafael J. Wysocki > Cc: Len Brown > Cc: Lv Zheng , > Cc: robert.moore@intel.com > Cc: linux-acpi@vger.kernel.org > Link: https://lkml.kernel.org/r/CAE9FiQVQx6FRXT-RdR7Crz4dg5LeUWHcUSy1KacjR+JgU_vGJg@mail.gmail.com > --- > arch/x86/kernel/acpi/boot.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c > index 32a7d70..6d35baf 100644 > --- a/arch/x86/kernel/acpi/boot.c > +++ b/arch/x86/kernel/acpi/boot.c > @@ -233,6 +233,9 @@ acpi_parse_lapic(struct acpi_subtable_header * header, const unsigned long end) > > acpi_table_print_madt_entry(header); > > + if (processor->id >= 0xff) > + return -EINVAL; > + > /* > * We need to register disabled CPU as well to permit > * counting disabled CPUs. This allows us to size some thing is wrong: [ 71.787437] ACPI: LAPIC (acpi_id[0xff] lapic_id[0xff] disabled) [ 71.799681] ACPI: Error parsing LAPIC/X2APIC entries [ 71.809934] ACPI: Invalid BIOS MADT, disabling ACPI looks like should change return -EINVAL ; ==> return 0;