提交 e7adcf6c 编写于 作者: L LeoLiu-oc 提交者: Zheng Zengkai

Add support for extended topology detection

zhaoxin inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I40QDN
CVE: NA

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

Newer Zhaoxin CPUs support get extended topology from CPUID leaf B/1F,
So add support for it.
Signed-off-by: NLeoLiu-oc <LeoLiu-oc@zhaoxin.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: NHanjun Guo <guohanjun@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 00b324ae
...@@ -122,6 +122,9 @@ static void early_init_centaur(struct cpuinfo_x86 *c) ...@@ -122,6 +122,9 @@ static void early_init_centaur(struct cpuinfo_x86 *c)
if (edx & (1U << 28)) if (edx & (1U << 28))
c->x86_coreid_bits = get_count_order((ebx >> 16) & 0xff); c->x86_coreid_bits = get_count_order((ebx >> 16) & 0xff);
} }
if (detect_extended_topology_early(c) < 0)
detect_ht_early(c);
} }
static void init_centaur(struct cpuinfo_x86 *c) static void init_centaur(struct cpuinfo_x86 *c)
...@@ -140,11 +143,14 @@ static void init_centaur(struct cpuinfo_x86 *c) ...@@ -140,11 +143,14 @@ static void init_centaur(struct cpuinfo_x86 *c)
clear_cpu_cap(c, 0*32+31); clear_cpu_cap(c, 0*32+31);
#endif #endif
early_init_centaur(c); early_init_centaur(c);
detect_extended_topology(c);
init_intel_cacheinfo(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 #ifdef CONFIG_X86_32
detect_ht(c); detect_ht(c);
#endif #endif
}
if (c->cpuid_level > 9) { if (c->cpuid_level > 9) {
unsigned int eax = cpuid_eax(10); unsigned int eax = cpuid_eax(10);
......
...@@ -79,16 +79,21 @@ static void early_init_zhaoxin(struct cpuinfo_x86 *c) ...@@ -79,16 +79,21 @@ static void early_init_zhaoxin(struct cpuinfo_x86 *c)
c->x86_coreid_bits = get_count_order((ebx >> 16) & 0xff); c->x86_coreid_bits = get_count_order((ebx >> 16) & 0xff);
} }
if (detect_extended_topology_early(c) < 0)
detect_ht_early(c);
} }
static void init_zhaoxin(struct cpuinfo_x86 *c) static void init_zhaoxin(struct cpuinfo_x86 *c)
{ {
early_init_zhaoxin(c); early_init_zhaoxin(c);
detect_extended_topology(c);
init_intel_cacheinfo(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 #ifdef CONFIG_X86_32
detect_ht(c); detect_ht(c);
#endif #endif
}
if (c->cpuid_level > 9) { if (c->cpuid_level > 9) {
unsigned int eax = cpuid_eax(10); unsigned int eax = cpuid_eax(10);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册