x86/cpu: Add detect extended topology for Zhaoxin CPUs

zhaoxin inclusion
category: feature
version: v3.0.6

-------------------

Detect the extended topology information of Zhaoxin CPUs if available.

Signed-off-by: leoliu-oc <leoliu-oc@zhaoxin.com>
This commit is contained in:
leoliu-oc 2024-08-26 16:31:48 +08:00
parent a51cde26d6
commit 4513f0a9b1
2 changed files with 13 additions and 2 deletions

View File

@ -115,6 +115,9 @@ static void early_init_centaur(struct cpuinfo_x86 *c)
set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);
set_cpu_cap(c, X86_FEATURE_NONSTOP_TSC);
}
if (detect_extended_topology_early(c) < 0)
detect_ht_early(c);
}
static void centaur_detect_vmx_virtcap(struct cpuinfo_x86 *c)
@ -158,11 +161,14 @@ static void init_centaur(struct cpuinfo_x86 *c)
clear_cpu_cap(c, 0*32+31);
#endif
early_init_centaur(c);
detect_extended_topology(c);
init_intel_cacheinfo(c);
detect_num_cpu_cores(c);
if (!cpu_has(c, X86_FEATURE_XTOPOLOGY)) {
detect_num_cpu_cores(c);
#ifdef CONFIG_X86_32
detect_ht(c);
#endif
}
if (c->cpuid_level > 9) {
unsigned int eax = cpuid_eax(10);

View File

@ -85,6 +85,8 @@ static void early_init_zhaoxin(struct cpuinfo_x86 *c)
c->x86_coreid_bits = get_count_order((ebx >> 16) & 0xff);
}
if (detect_extended_topology_early(c) < 0)
detect_ht_early(c);
}
static void zhaoxin_detect_vmx_virtcap(struct cpuinfo_x86 *c)
@ -115,11 +117,14 @@ static void zhaoxin_detect_vmx_virtcap(struct cpuinfo_x86 *c)
static void init_zhaoxin(struct cpuinfo_x86 *c)
{
early_init_zhaoxin(c);
detect_extended_topology(c);
init_intel_cacheinfo(c);
detect_num_cpu_cores(c);
if (!cpu_has(c, X86_FEATURE_XTOPOLOGY)) {
detect_num_cpu_cores(c);
#ifdef CONFIG_X86_32
detect_ht(c);
#endif
}
if (c->cpuid_level > 9) {
unsigned int eax = cpuid_eax(10);