Re: [PATCH v3 2/2] x86/amd_node: Remove smn_exclusive

From: Borislav Petkov

Date: Mon Aug 31 2026 - 20:41:36 EST


On Mon, Aug 31, 2026 at 01:52:08PM -0400, Jason Andryuk wrote:
> No, the code and the comment are both correct as posted. It's just that I
> wrote the comment reversed from the code to state the positive property we
> want.

So if amd_smn_init() succeeds, that means we have registered the PCI config
regions of the PCI roots, including the SMN ones, as IORESOURCE_EXCLUSIVE and
they won't be exported to userspace through /dev/mem and what not.

So, any caller of __amd_smn_rw() should fail because it is coming from kernel
space and it can expect that userspace could interfere with the hw and thus
not a good idea.

So yes, this is what got me confused and the (!amd_roots) check is correct.

> I'll change this whichever way you want. It's not a big deal, which is why
> I added the comment like you requested originally.

I think I already "intercepted" your suggestion, see here: