lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <769e14c9-298d-3049-4001-2a8fe903d21e@cn.fujitsu.com>
Date:   Wed, 2 May 2018 09:56:51 +0800
From:   Dou Liyang <douly.fnst@...fujitsu.com>
To:     Jan Beulich <JBeulich@...e.com>
CC:     <tglx@...utronix.de>, <linux-kernel@...r.kernel.org>
Subject: Re: recent patch "x86/acpi: Prevent X2APIC id 0xffffffff from being
 accounted"



At 04/27/2018 08:09 PM, Jan Beulich wrote:
>>>> On 27.04.18 at 10:32, <douly.fnst@...fujitsu.com> 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
> 
> 
> 
> 
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ