[RFC][PATCH 0/6] x86/topo: SNC Divination

Peter Zijlstra posted 6 patches 1 month, 1 week ago
There is a newer version of this series
[RFC][PATCH 0/6] x86/topo: SNC Divination
Posted by Peter Zijlstra 1 month, 1 week ago
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.
Re: [RFC][PATCH 0/6] x86/topo: SNC Divination
Posted by Luck, Tony 1 month, 1 week ago
On Thu, Feb 26, 2026 at 11:49:09AM +0100, Peter Zijlstra wrote:
> Compile and boot tested on non SNC only for now; I'll see if I can convince
> qemu to play along.

Tried it on an SNC 3 system. The resctrl patch still gets the right value
with these patches applied.

Tested-by: Tony Luck <tony.luck@intel.com>

-Tony
Re: [RFC][PATCH 0/6] x86/topo: SNC Divination
Posted by Kyle Meyer 1 month ago
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>