Skip to content

Commit 598e719

Browse files
committed
x86/cpu: Use common topology code for Centaur and Zhaoxin
Centaur and Zhaoxin CPUs use only the legacy SMP detection. Remove the invocations from their 32bit path and exclude them from the 64-bit call path. No functional change intended. Signed-off-by: Thomas Gleixner <[email protected]> Tested-by: Juergen Gross <[email protected]> Tested-by: Sohil Mehta <[email protected]> Tested-by: Michael Kelley <[email protected]> Tested-by: Zhang Rui <[email protected]> Tested-by: Wang Wendy <[email protected]> Tested-by: K Prateek Nayak <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent bda74aa commit 598e719

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

arch/x86/kernel/cpu/centaur.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,6 @@ static void init_centaur(struct cpuinfo_x86 *c)
128128
#endif
129129
early_init_centaur(c);
130130
init_intel_cacheinfo(c);
131-
detect_num_cpu_cores(c);
132-
#ifdef CONFIG_X86_32
133-
detect_ht(c);
134-
#endif
135131

136132
if (c->cpuid_level > 9) {
137133
unsigned int eax = cpuid_eax(10);

arch/x86/kernel/cpu/topology_common.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ static unsigned int __maybe_unused parse_num_cores_legacy(struct cpuinfo_x86 *c)
4242
return eax.ncores + 1;
4343
}
4444

45-
static void __maybe_unused parse_legacy(struct topo_scan *tscan)
45+
static void parse_legacy(struct topo_scan *tscan)
4646
{
4747
unsigned int cores, core_shift, smt_shift = 0;
4848
struct cpuinfo_x86 *c = tscan->c;
@@ -71,10 +71,8 @@ bool topo_is_converted(struct cpuinfo_x86 *c)
7171
/* Temporary until everything is converted over. */
7272
switch (boot_cpu_data.x86_vendor) {
7373
case X86_VENDOR_AMD:
74-
case X86_VENDOR_CENTAUR:
7574
case X86_VENDOR_INTEL:
7675
case X86_VENDOR_HYGON:
77-
case X86_VENDOR_ZHAOXIN:
7876
return false;
7977
default:
8078
/* Let all UP systems use the below */
@@ -132,6 +130,13 @@ static void parse_topology(struct topo_scan *tscan, bool early)
132130
return;
133131

134132
tscan->ebx1_nproc_shift = get_count_order(ebx.nproc);
133+
134+
switch (c->x86_vendor) {
135+
case X86_VENDOR_CENTAUR:
136+
case X86_VENDOR_ZHAOXIN:
137+
parse_legacy(tscan);
138+
break;
139+
}
135140
}
136141

137142
static void topo_set_ids(struct topo_scan *tscan)

arch/x86/kernel/cpu/zhaoxin.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,6 @@ static void init_zhaoxin(struct cpuinfo_x86 *c)
7171
{
7272
early_init_zhaoxin(c);
7373
init_intel_cacheinfo(c);
74-
detect_num_cpu_cores(c);
75-
#ifdef CONFIG_X86_32
76-
detect_ht(c);
77-
#endif
7874

7975
if (c->cpuid_level > 9) {
8076
unsigned int eax = cpuid_eax(10);

0 commit comments

Comments
 (0)