[PATCH] x86/cpu: detect extended topology for Zhaoxin CPUs

Tony W Wang-oc posted 1 patch 1 month, 1 week ago
arch/x86/kernel/cpu/topology_common.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
[PATCH] x86/cpu: detect extended topology for Zhaoxin CPUs
Posted by Tony W Wang-oc 1 month, 1 week ago
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 <TonyWWang-oc@zhaoxin.com>
---
 arch/x86/kernel/cpu/topology_common.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/topology_common.c b/arch/x86/kernel/cpu/topology_common.c
index b5a5e1411469..913dbf43389a 100644
--- a/arch/x86/kernel/cpu/topology_common.c
+++ b/arch/x86/kernel/cpu/topology_common.c
@@ -159,7 +159,8 @@ static void parse_topology(struct topo_scan *tscan, bool early)
 		break;
 	case X86_VENDOR_CENTAUR:
 	case X86_VENDOR_ZHAOXIN:
-		parse_legacy(tscan);
+		if (!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))
-- 
2.25.1