On Thu, Feb 26, 2026 at 11:49:09AM +0100, Peter Zijlstra wrote:
> Hi!
>
> So we once again ran head-first into the fact that the CPUs fail to enumerate
> useful state. This time it is SNC (again).
>
> Thomas recently rewrote much of the topology code to use MADT and CPUID to
> derive many of the useful measure of the system *before* SMP bringup. Removing
> much broken magic.
>
> Inspired by that, I wondered if we might do the same for SNC. Clearly MADT is
> not sufficient, however combined with SRAT we should have enough.
>
> Further luck will have it that by the time MADT gets parsed, SRAT is already
> parsed, so integrating them is mostly straight forward. The only caveat is that
> numa_emulation can mess things up in between.
>
> Combining all this gives a straight forward measure of nodes-per-package, which
> should reflect the SNC mode. All before SMP bringup.
>
> Use this to 'fix' various SNC snafus.
>
> Compile and boot tested on non SNC only for now; I'll see if I can convince
> qemu to play along.
Thank you for the series!
Tested on a Sapphire Rapids system with SNC-4, SNC-2, and SNC disabled.
Tested on a Granite Rapids system with SNC-2 and SNC disabled.
The nodes per package were correct.
I don't have access to a system with CXL attached memory.
Tested-by: Kyle Meyer <kyle.meyer@hpe.com>