Received: by 10.192.165.148 with SMTP id m20csp116601imm; Tue, 1 May 2018 18:57:19 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrq/gbPh7euNWSr2zZgXvmzQBZcd6FLi3slyd0NAg+05BjLI/dGSaPBR3MYa32dUHHd/FGH X-Received: by 2002:a17:902:848e:: with SMTP id c14-v6mr15125301plo.129.1525226239406; Tue, 01 May 2018 18:57:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525226239; cv=none; d=google.com; s=arc-20160816; b=YAC854x0mIkn5OqAqoFMOsupQYAMjsC3rE+3fNXxKwMTy74GjDL9Vx8FKQ5BdZVNKN w5TpPwm7metA07z1lD2tNSHPPhkt0iROUxgTRCt4fpY7Ko+269rQ8fXEnjyOJ+OH5CSV spp9b2yZLxeOmd/c+Hwk2pwS0ESimCdLMeADexMp4M8OIVR7uu+n4Mg72f8D1EmLr4mE SFjQ1xNKsSnMDlKA46vPaBVg5VMf/y9ksz15bWeaHzXYyhN+s6X38Yib+8I3MVeg22vH +nHS13sAs8AdgFaC22ZHYjSsknfpbyyMYMxSNlWW5ce5BHULAmsasF6Xu2RudRJgH/0Z M/fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=s23wDq0ACdkqnd5YjVEUhKE6UpuCYSAKlJ3owp7EWOc=; b=w6WvaIP19IHB1IuVlzY3Y8x9kKJa9C+YklWt1H2T80okeKBORYGClpSIojMUN4gbxM f9jHadIyXpwlShQia5EjEptg9QeDwBXShQmxDrXw+NzxWt/WFosqyX52wT4VWOPp6EMZ loWTT9Evv+uFMyFra3ryzCvTBh+hwpA2Dq1O9JPDSfFYqEju20zrKcQh72+Q2mnks2F3 JRE84xbmmPNHMzPPnasF7QjGRLBj2Widz+xKVyJfjC0ZwHwlRQitw9xfH9kVG0l6fWOw eTDrsTlzpCZDiRUG3iyUfPD+HjkMp6LKGnCwv2erldzwjG2hLV8RG9813A/tpZaJnYav VQHQ== 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 i67si10603468pfi.95.2018.05.01.18.57.04; Tue, 01 May 2018 18:57:19 -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 S1751055AbeEBB4z (ORCPT + 99 others); Tue, 1 May 2018 21:56:55 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:1817 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750823AbeEBB4y (ORCPT ); Tue, 1 May 2018 21:56:54 -0400 X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="39469978" Received: from bogon (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 02 May 2018 09:56:53 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (unknown [10.167.33.83]) by cn.fujitsu.com (Postfix) with ESMTP id 1D5D64B34D23; Wed, 2 May 2018 09:56:54 +0800 (CST) Received: from localhost.localdomain (10.167.226.106) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 2 May 2018 09:56:52 +0800 Subject: Re: recent patch "x86/acpi: Prevent X2APIC id 0xffffffff from being accounted" To: Jan Beulich CC: , References: <5AE2CF8802000078001BF017@prv1-mh.provo.novell.com> <12fd36d0-1678-ed57-fec3-c94b430bd23f@cn.fujitsu.com> <5AE3130702000078001BF180@prv1-mh.provo.novell.com> From: Dou Liyang Message-ID: <769e14c9-298d-3049-4001-2a8fe903d21e@cn.fujitsu.com> Date: Wed, 2 May 2018 09:56:51 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <5AE3130702000078001BF180@prv1-mh.provo.novell.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.167.226.106] X-yoursite-MailScanner-ID: 1D5D64B34D23.A8837 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: douly.fnst@cn.fujitsu.com X-Spam-Status: No Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org At 04/27/2018 08:09 PM, Jan Beulich wrote: >>>> On 27.04.18 at 10:32, wrote: >> At 04/27/2018 03:21 PM, Jan Beulich wrote: >>> I've just stumbled across this commit, and I'm wondering if that's actually >>> correct (I too have at least one system where such IDs are reported in >>> MADT): For offline/absent CPUs, the firmware may not know the APIC IDs >> >> The MADT table is not reasonable, the Local APIC entries(xAPIC/x2APIC) >> in MADT is not always correct as OS want. So, we should do this sanity >> check. > > Of course, sanity checking is necessary. > >>> at the point MADT is built, so I think it is quite reasonable to put ~0 in >>> there. The ACPID spec specifically calls out that the IDs must not change >>> across sleep states, which implies to me that they may change across an >>> offline period of a CPU. IOW I think such entries still need to contribute to >>> the count of disabled CPUs. >> >> Aha, there are no CPU devices which will map it's physical ID to the >> illegal number 0xffffffff, So it will never be used. > > The ID will never be used, yes, but the CPU may be (after firmware has > assigned it a valid ID). > >> BTW, Limiting the number of the disabled CPUs is also a goal. > > I'm afraid I don't understand: Limiting the number of disabled CPUs is > certainly desirable when those can never be used, but why would you > want to do this when they might later get hotplugged? I'm not aware Let's see the workflow of CPU hotplug:   1) get the CPU device info from ACPI namespace      - it contains logical processor id   2) through the logical processor id, get the LACPI entry in MADT.   3) generate the CPU for kernel(will create a CPU id, can see by lscpu) Normally, there are no valid CPU devices in 1) which are mapped to the LACPI entries(0xff or 0xffffffff). The actually number of hotplugged CPUs depends on CPU devices/processors in ACPI namespace. The number calculated from MADT is the maximum situation which can be cut and doesn't affect CPU hotplug. Don't worry about it. Now, in ACPI-based system, Linux gets the number of possible CPUs by MADT, We are going to use the ACPI namespace to make the number accurate. But it is so hard, because it's so late to initialize the ACPI namespace. Thanks, dou > of a way to tell, by just looking at the MADT, which of the two cases > apply. > > Jan > > > > >