Re: [PATCH] x86: Avoid divide by 0 in amd_smn_init()

From: Jason Andryuk

Date: Wed Jun 24 2026 - 15:09:22 EST


On 2026-06-24 13:15, Borislav Petkov wrote:
On Wed, Jun 24, 2026 at 12:41:48PM -0400, Jason Andryuk wrote:
I think this is the issue:

The "root" device search was introduced to support SMN access for Zen
systems. This device represents a PCIe root complex. It is not the
same as the "CPU/node" devices found at slots 0x18-0x1F.

What is that? AI output?

It's from the commit message of 40a5f6ffdfc8f8ed0d8c535dfa3733b31c66a88c

We don't want dom0 to access the "CPU/node" devices. It's the "root" device
SMN access I am trying to retain.

I know what you're trying to do - you want to use SMN accesses on dom0. And
I'm trying to figure out a stable detection method on Xen which is future
proof.

Many amd_smn_read/write calls have hardcoded node 0, like for amd-pmc.

Maybe.

Whatever it is, it needs to be a long-term solution and properly vetted by Xen
folks so that we don't do crazy hacks for Xen's sake everytime.

Sure.

I think Ingo's suggestion to re-add the check will at least get systems booting again. Then when Xen SMN accesses is sorted out, that can be changed as necessary.

Regards,
Jason