From de350b1f1c1e7902869f7d3cbd3206a86880c797 Mon Sep 17 00:00:00 2001 From: leoliu-oc Date: Mon, 9 Mar 2026 14:32:56 +0800 Subject: [PATCH] x86/cpu: detect extended topology for Zhaoxin CPUs zhaoxin inclusion category: feature -------------------- Zhaoxin CPUs support extended topology enumeration CPUID leaf 0xb/0x1f. Zhaoxin's new product, the KH-50000, features a single socket with 96 cores and support 2/4 sockets interconnects. Additionally, the Zhaoxin KH-50000 requires the use of extended CPUID leaf 0xb/0x1f to retrieve cputopo information. Right now the kernel uses the legacy CPUID leaf 0x1/0x4 for topology detection for Zhaoxin CPUs. So add extended topology detection support for Zhaoxin CPUs. Signed-off-by: Tony W Wang-oc Signed-off-by: leoliu-oc --- arch/x86/kernel/cpu/topology_common.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/topology_common.c b/arch/x86/kernel/cpu/topology_common.c index 9a6069e7133c..0da37096cde5 100644 --- a/arch/x86/kernel/cpu/topology_common.c +++ b/arch/x86/kernel/cpu/topology_common.c @@ -126,8 +126,12 @@ static void parse_topology(struct topo_scan *tscan, bool early) cpu_parse_topology_amd(tscan); break; case X86_VENDOR_CENTAUR: + if (!IS_ENABLED(CONFIG_CPU_SUP_CENTAUR) || !cpu_parse_topology_ext(tscan)) + parse_legacy(tscan); + break; case X86_VENDOR_ZHAOXIN: - parse_legacy(tscan); + if (!IS_ENABLED(CONFIG_CPU_SUP_ZHAOXIN) || !cpu_parse_topology_ext(tscan)) + parse_legacy(tscan); break; case X86_VENDOR_INTEL: if (!IS_ENABLED(CONFIG_CPU_SUP_INTEL) || !cpu_parse_topology_ext(tscan)) -- Gitee