Re: [Patch v2 2/2] x86/tsc: use logical_packages as a better estimation of socket numbers

From: Zhang, Rui
Date: Fri Jun 16 2023 - 07:23:28 EST


On Fri, 2023-06-16 at 11:42 +0200, Peter Zijlstra wrote:
> On Fri, Jun 16, 2023 at 09:19:18AM +0000, Zhang, Rui wrote:
>
> > According to the MADT, there are indeed 40 valid CPUs. And then 80
> > CPUs
> > with
> >
> > APIC ID         : FF
> > enabled         : 0
> > Online capable  : 0
> >
> > a dumb question, why are these CPUs added into the possible_mask?
> > I can dig into this later but I just don't have a quick answer at
> > the
> > moment.
>
> I really don't know.. I've not gotten around to reading that part of
> the
> x86 code yet.
>
>
I did a double check.

The MADT is composed of

1. 40 valid LAPIC entries.
2. 80 invalid LAPIC entries with
APIC ID : FF
Enabled : 0
Online capable: 0
I'm mot sure why "Online capable" is decoded because this new bit is
introduced in ACPI 6.3. Maybe a problem in the acpica tool?
These entries are ignored because of the invalid APIC ID.
3. 120 x2APIC entries with
APIC ID : valid value
Enabled : 0
As "Online capable bit" is not supported, these 120 x2APIC entries
are counted as possible CPUs.

That is why we got 160 possible CPUs.

thanks,
rui