提交 f4d7d602 编写于 作者: X Xie Haocheng

x86/cpufeatures: Fix cpu capabilities incorrect detection.

amd inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I6A0G7
CVE: NA

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

Below AMD platform features are incorrect detected:

X86_FEATURE_SME,
X86_FEATURE_SEV,
X86_FEATURE_VM_PAGE_FLUSH,
X86_FEATURE_SEV_ES,
X86_FEATURE_SME_COHERENT

This bug is introduced by commit ac376dd8.
The definition and use of CPUID_8000_001F_EAX will cause c.x86_capability
get a conflict wrong value.
Signed-off-by: NXie Haocheng <haocheng.xie@amd.com>
上级 5a5e1a24
......@@ -31,7 +31,6 @@ enum cpuid_leafs
CPUID_7_ECX,
CPUID_8000_0007_EBX,
CPUID_7_EDX,
CPUID_8000_001F_EAX,
};
#ifdef CONFIG_X86_FEATURE_NAMES
......
......@@ -963,9 +963,6 @@ void get_cpu_cap(struct cpuinfo_x86 *c)
if (c->extended_cpuid_level >= 0x8000000a)
c->x86_capability[CPUID_8000_000A_EDX] = cpuid_edx(0x8000000a);
if (c->extended_cpuid_level >= 0x8000001f)
c->x86_capability[CPUID_8000_001F_EAX] = cpuid_eax(0x8000001f);
init_scattered_cpuid_features(c);
init_speculation_control(c);
......
......@@ -44,6 +44,11 @@ static const struct cpuid_bit cpuid_bits[] = {
{ X86_FEATURE_PROC_FEEDBACK, CPUID_EDX, 11, 0x80000007, 0 },
{ X86_FEATURE_MBA, CPUID_EBX, 6, 0x80000008, 0 },
{ X86_FEATURE_PERFMON_V2, CPUID_EAX, 0, 0x80000022, 0 },
{ X86_FEATURE_SME, CPUID_EAX, 0, 0x8000001f, 0 },
{ X86_FEATURE_SEV, CPUID_EAX, 1, 0x8000001f, 0 },
{ X86_FEATURE_VM_PAGE_FLUSH, CPUID_EAX, 2, 0x8000001f, 0 },
{ X86_FEATURE_SEV_ES, CPUID_EAX, 3, 0x8000001f, 0 },
{ X86_FEATURE_SME_COHERENT, CPUID_EAX, 10, 0x8000001f, 0 },
{ 0, 0, 0, 0, 0 }
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册