[PATCH v3 2/6] x86/amd_nb: Restrict NB framework init to AMD vendor

From: Lin Wang

Date: Thu Jul 09 2026 - 03:58:25 EST


Drop the X86_VENDOR_HYGON branch from init_amd_nbs() and
early_is_amd_nb(). Both functions are entry points to the AMD NB
framework, which uses the legacy fixed-slot PCI enumeration model
(slot 0x18+i for node i) and the AMD-only amd_nb_misc_ids[] device-ID
table.

On Hygon Family 0x18, these paths do not find usable AMD NB entries:
amd_cache_northbridges() probes the AMD fixed slots, while
early_is_amd_nb() matches only AMD IDs from amd_nb_misc_ids[].

Restrict these AMD framework entry points to AMD vendor. Hygon DF
enumeration is added separately in arch/x86/kernel/hygon_node.c.

No user-visible functional regression on Hygon Fam18h.

amd_get_mmconfig_range() is intentionally left unchanged: it reads
the MSR_FAM10H_MMIO_CONF_BASE shared CPU MSR and serves
arch/x86/pci/amd_bus.c and drivers/pnp/quirks.c on Hygon platforms.

Signed-off-by: Lin Wang <wanglin@xxxxxxxxxxxxxx>
---
arch/x86/kernel/amd_nb.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kernel/amd_nb.c b/arch/x86/kernel/amd_nb.c
index 5d364540673d..848ed2ca17c3 100644
--- a/arch/x86/kernel/amd_nb.c
+++ b/arch/x86/kernel/amd_nb.c
@@ -125,8 +125,7 @@ bool __init early_is_amd_nb(u32 device)
const struct pci_device_id *id;
u32 vendor = device & 0xffff;

- if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD &&
- boot_cpu_data.x86_vendor != X86_VENDOR_HYGON)
+ if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD)
return false;

if (cpu_feature_enabled(X86_FEATURE_ZEN))
@@ -315,8 +314,7 @@ static __init void fix_erratum_688(void)

static __init int init_amd_nbs(void)
{
- if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD &&
- boot_cpu_data.x86_vendor != X86_VENDOR_HYGON)
+ if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD)
return 0;

amd_cache_northbridges();
--
2.43.0