[PATCH v4 0/5] x86/hygon: Add Family 0x18 DF node enumeration and SMN access
From: Lin Wang
Date: Tue Sep 01 2026 - 03:26:18 EST
This revision addresses the Sashiko comments on v3.
Sashiko noted that v3 disabled AMD NB and SMN initialization on Hygon
while amd64_edac, ATL and k10temp could still call those interfaces. V4
restores the pre-v3 AMD NB behavior and leaves those drivers unchanged.
The broad SMN exclusion is replaced by a model-specific handoff to the
Hygon SMN setup.
However, restoring AMD NB initialization does not make the AMD paths
usable for the Family 0x18 topology covered here. AMD NB maps nodes 0
through 7 to fixed PCI slots. Hygon discovers F3 devices by PCI ID, may
expose more than eight DF nodes, reports sparse CPU NodeIds, and groups
SMN roots by socket.
This series adds the Hygon node and SMN interfaces first so the Hygon
paths in those drivers can be converted separately.
The AMD-side changes check smn_exclusive before accessing amd_roots.
On these models, amd_smn_init() does not reserve the roots needed by
Hygon SMN setup. AMD SMN calls return -ENODEV until their callers use
the Hygon interfaces. The remaining Hygon handling in amd_nb.c and
amd_node.c can then be removed separately.
Sashiko also found that v3 retained pci_get_class() iterator devices
without owning references. The Hygon setup now holds a reference for
every reserved root and releases all references and config regions on
failure.
The corresponding reference and roots_per_node issues in
amd_smn_init() predate this series. Yazen confirmed them and is handling
the AMD fixes separately.
The node and SMN implementation has been tested on a Family 0x18 Model
0x07 system with 2 sockets, 12 CDDs and 4 IODs.
Changes in v4:
- Drop the v3 AMD NB vendor restriction. (Sashiko)
- Replace the vendor-wide AMD SMN exclusion with a model-scoped
handoff. (Sashiko)
- Hold references for reserved Hygon SMN roots and release all
resources on setup failure. (Sashiko)
- Drop the SMN debugfs interface.
Links:
Sashiko v3 review:
https://sashiko.dev/#/patchset/20260709075549.626095-1-wanglin%40open-hieco.net
RFC v1:
https://lore.kernel.org/all/20260402111515.1155505-1-wanglin@xxxxxxxxxxxxxx/
RFC v2:
https://lore.kernel.org/all/20260423060420.1785357-1-wanglin@xxxxxxxxxxxxxx/
v3:
https://lore.kernel.org/all/20260709075549.626095-1-wanglin@xxxxxxxxxxxxxx/
Lin Wang (5):
pci_ids: Add Hygon Family 0x18 DF F3/F4 device IDs
x86/hygon: Add Family 0x18 DF node enumeration
x86/hygon: Map CPU NodeIds to DF nodes
x86/amd_node: Skip SMN setup on Hygon Fam18h models 0x04-0x08
x86/hygon: Add Family 0x18 SMN access
MAINTAINERS | 3 +
arch/x86/Kconfig | 4 +
arch/x86/include/asm/hygon/node.h | 207 ++++++
arch/x86/kernel/Makefile | 1 +
arch/x86/kernel/amd_node.c | 18 +-
arch/x86/kernel/hygon_node.c | 1011 +++++++++++++++++++++++++++++
include/linux/pci_ids.h | 6 +
7 files changed, 1247 insertions(+), 3 deletions(-)
create mode 100644 arch/x86/include/asm/hygon/node.h
create mode 100644 arch/x86/kernel/hygon_node.c
base-commit: abdf623ddb75b24659018d3952d8f61937306ae5
--
2.43.0