RE: [RFC PATCH V2 0/1] x86: cpu topology fix and question on x86_max_cores

From: Brown, Len
Date: Tue Mar 07 2023 - 21:47:13 EST


Yes, On Intel, Linux should be able assert that CPUID.1F has exactly the same "level" definitions on all CPUs in the system -- no matter SMP or Hybrid processor.

This is what Thomas is asking for -- an architectural APIC-ID decoder -- not a future feature, but one that is already shipping.

With this decoder, we can parse the ACPI BIOS APIC/MADT.
As Peter asserts, the list of processors in the MADT has to work, else smpboot would not be working.

If we don't already have a check that the INIT to APIC-ID N really wakes up N, and not some other id,
It shouldn't be hard to add that sanity check...

Anyway, trusting the MADT, and CPUID.1F, we can determine from cpu0 if we are going to boot any SMT siblings or not.
Indeed, we know ahead of time all of the CPUID.1F levels, including the implicit which level -- which CPUs are in which packages,
And thus how many packages.

-Len