Re: [PATCH v7 6/7] x86/amd_node: Restrict SMN setup to AMD CPUs

From: Yazen Ghannam

Date: Sat Oct 17 2026 - 11:33:51 EST


On Fri, Oct 09, 2026 at 05:01:10PM +0800, Lin Wang wrote:
> amd_smn_init() also runs on Hygon because Hygon sets X86_FEATURE_ZEN.
> It reserves config space on the matching host-bridge roots and groups
> them by the CPU-derived node count. Hygon DF nodes are enumerated by
> PCI ID, CPU NodeIds are sparse, and the nodes in a socket share one SMN
> ingress, so the resulting root map is wrong on Hygon. These reservations
> also prevent the Hygon node layer from claiming roots for its own
> node-to-root mapping.
>
> The preceding patches remove the Hygon matches from amd64_edac and ATL.
> This change also requires "hwmon: (k10temp) Stop matching Hygon devices".

Suggestion:
"Hygon vendor matching has been removed from amd64_edac, amd_atl, and
k10temp modules."

I think the note below is suffient for the k10temp patch dependency.

> The remaining users match AMD PCI IDs or check for an AMD CPU.
> With these changes in place, no in-tree Hygon driver uses the AMD
> SMN accessors.
>
> Restrict SMN setup and root discovery to AMD CPUs.
>
> Signed-off-by: Lin Wang <wanglin@xxxxxxxxxxxxxx>
> ---
>
> Notes (hygon-node-deps):
> Depends on commit 08e6615c909b ("hwmon: (k10temp) Stop matching Hygon
> devices") in hwmon-next, which is not in mainline yet. It must be merged
> before this patch.
>
> arch/x86/kernel/amd_node.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/kernel/amd_node.c b/arch/x86/kernel/amd_node.c
> index b7926ba3610a..c36b410d04a4 100644
> --- a/arch/x86/kernel/amd_node.c
> +++ b/arch/x86/kernel/amd_node.c
> @@ -229,8 +229,7 @@ static struct pci_dev *get_next_root(struct pci_dev *root)
> if (root->devfn)
> continue;
>
> - if (root->vendor != PCI_VENDOR_ID_AMD &&
> - root->vendor != PCI_VENDOR_ID_HYGON)
> + if (root->vendor != PCI_VENDOR_ID_AMD)
> continue;
>
> break;
> @@ -253,6 +252,9 @@ static int __init amd_smn_init(void)
> u16 count, num_roots, roots_per_node, node, num_nodes;
> struct pci_dev *root __free(pci_dev_put) = NULL;
>
> + if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD)
> + return 0;
> +
> if (!cpu_feature_enabled(X86_FEATURE_ZEN))
> return 0;
>
> --

Reviewed-by: Yazen Ghannam <yazen.ghannam@xxxxxxx>

Thanks,
Yazen