Skip to content

Commit 517c3ba

Browse files
Zhenzhong DuanKAGA-KOKO
authored andcommitted
x86/speculation/mds: Apply more accurate check on hypervisor platform
X86_HYPER_NATIVE isn't accurate for checking if running on native platform, e.g. CONFIG_HYPERVISOR_GUEST isn't set or "nopv" is enabled. Checking the CPU feature bit X86_FEATURE_HYPERVISOR to determine if it's running on native platform is more accurate. This still doesn't cover the platforms on which X86_FEATURE_HYPERVISOR is unsupported, e.g. VMware, but there is nothing which can be done about this scenario. Fixes: 8a4b06d ("x86/speculation/mds: Add sysfs reporting for MDS") Signed-off-by: Zhenzhong Duan <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected]
1 parent 643d83f commit 517c3ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kernel/cpu/bugs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1226,7 +1226,7 @@ static ssize_t l1tf_show_state(char *buf)
12261226

12271227
static ssize_t mds_show_state(char *buf)
12281228
{
1229-
if (!hypervisor_is_type(X86_HYPER_NATIVE)) {
1229+
if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) {
12301230
return sprintf(buf, "%s; SMT Host state unknown\n",
12311231
mds_strings[mds_mitigation]);
12321232
}

0 commit comments

Comments
 (0)