Received: by 10.192.165.156 with SMTP id m28csp1646171imm; Tue, 17 Apr 2018 03:02:56 -0700 (PDT) X-Google-Smtp-Source: AIpwx48kmUBwcXTAn6ox+8G8PLqAcr6QH3M5l9iUZ5XBCqFSm4s9Ir0nfdWlmNdpDVYjMbEHch+S X-Received: by 10.101.86.202 with SMTP id w10mr1283843pgs.242.1523959376528; Tue, 17 Apr 2018 03:02:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523959376; cv=none; d=google.com; s=arc-20160816; b=BzLl+OSsyIG+qFjEtVcWJFXqe6X2uMNoy4v9/gpy7RwLG2is/lUceh8mW+IJV8KAeg 4f2hJHIlcLal3C7bAAMf5ql2yBp1vW+ePXQqkkFWOkdLOxg0dL9/NXVlabF6agNhK1L6 W3D8aAZLOMLsq2rQEOUsV/9lA1g1Ph0nEhM73zUdQvGT/CzkNAMH7AgN8zDg8paP0i2w H6DwXA3gsKT2O0Bl4BeC78k8tMJrxl5mTnFf2jVR5TbWjzMxu/Zgf48Wx3yHdO6HLxKd qqauQO33wfyQoBieu5tg0aWpD6531P+mSUl1LK2veWme9Tc0nYDQQ8VMk27VgbEK5mQu 21kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=yBY6wUPH5mt8y1ACkrGY/lIpi2GUvvULXky4ShOr+yE=; b=iRAy3ej0qG2jUns8C8aYK26sWKc1485fN5RVQBgWUxC9E4buy3nmTpkSsGuuhUT7dP AeRyqEQkR0SXX9/806Onq7ihl7VYgkuqvIlS0e6I9wlgAuWRMqZubJnZA49mJx1JSape GBeSyTStQfhR0lo1EEnfKOHSpAT78Jt2SL/4FkP6yY9U1VxXLH0A0PGIy6iudA9WIiTG oXsmanFuAHMMveSdIUE0G941hzsUJdKaO59rHeqW4ic/LnXrAoyH9QDuaNjqZv7Ul7ph B/oa4+TLMA5eeBomZ6lVFx9m3QOlRtNgOsWhnpFQkJkz6BDwfiia17AraSQG4ONrmQbr UmxQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g28-v6si8203485plj.529.2018.04.17.03.02.42; Tue, 17 Apr 2018 03:02:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752199AbeDQKBb (ORCPT + 99 others); Tue, 17 Apr 2018 06:01:31 -0400 Received: from terminus.zytor.com ([198.137.202.136]:42987 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751810AbeDQKBa (ORCPT ); Tue, 17 Apr 2018 06:01:30 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w3HA10qW855974; Tue, 17 Apr 2018 03:01:00 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w3HA0xfR855971; Tue, 17 Apr 2018 03:00:59 -0700 Date: Tue, 17 Apr 2018 03:00:59 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Dou Liyang Message-ID: Cc: hpa@zytor.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, lirongqing@baidu.com, mingo@kernel.org, douly.fnst@cn.fujitsu.com Reply-To: douly.fnst@cn.fujitsu.com, mingo@kernel.org, lirongqing@baidu.com, hpa@zytor.com, tglx@linutronix.de, linux-kernel@vger.kernel.org In-Reply-To: <20180412014052.25186-1-douly.fnst@cn.fujitsu.com> References: <20180412014052.25186-1-douly.fnst@cn.fujitsu.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/acpi: Prevent X2APIC id 0xffffffff from being accounted Git-Commit-ID: 10daf10ab154e31237a8c07242be3063fb6a9bf4 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 10daf10ab154e31237a8c07242be3063fb6a9bf4 Gitweb: https://git.kernel.org/tip/10daf10ab154e31237a8c07242be3063fb6a9bf4 Author: Dou Liyang AuthorDate: Thu, 12 Apr 2018 09:40:52 +0800 Committer: Thomas Gleixner CommitDate: Tue, 17 Apr 2018 11:56:31 +0200 x86/acpi: Prevent X2APIC id 0xffffffff from being accounted RongQing reported that there are some X2APIC id 0xffffffff in his machine's ACPI MADT table, which makes the number of possible CPU inaccurate. The reason is that the ACPI X2APIC parser has no sanity check for APIC ID 0xffffffff, which is an invalid id in all APIC types. See "IntelĀ® 64 Architecture x2APIC Specification", Chapter 2.4.1. Add a sanity check to acpi_parse_x2apic() which ignores the invalid id. Reported-by: Li RongQing Signed-off-by: Dou Liyang Signed-off-by: Thomas Gleixner Cc: stable@vger.kernel.org Cc: len.brown@intel.com Cc: rjw@rjwysocki.net Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/20180412014052.25186-1-douly.fnst@cn.fujitsu.com --- arch/x86/kernel/acpi/boot.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index dde444f932c1..3b20607d581b 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c @@ -215,6 +215,10 @@ acpi_parse_x2apic(struct acpi_subtable_header *header, const unsigned long end) apic_id = processor->local_apic_id; enabled = processor->lapic_flags & ACPI_MADT_ENABLED; + /* Ignore invalid ID */ + if (apic_id == 0xffffffff) + return 0; + /* * We need to register disabled CPU as well to permit * counting disabled CPUs. This allows us to size