summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhenzhong Duan <zhenzhong.duan@oracle.com>2019-07-25 10:39:09 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-07-31 07:27:10 +0200
commit7d20e3ba707211c9e571cf0a5fc5fc0442f74313 (patch)
treecfe293e21aa627e2ad38fe846b653b2f71d54e8f
parent5e87e8b4dc0cfaffe3a1fa04b92a096244d227ef (diff)
downloadlinux-stable-7d20e3ba707211c9e571cf0a5fc5fc0442f74313.tar.gz
linux-stable-7d20e3ba707211c9e571cf0a5fc5fc0442f74313.tar.bz2
linux-stable-7d20e3ba707211c9e571cf0a5fc5fc0442f74313.zip
x86/speculation/mds: Apply more accurate check on hypervisor platform
commit 517c3ba00916383af6411aec99442c307c23f684 upstream. 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: 8a4b06d391b0 ("x86/speculation/mds: Add sysfs reporting for MDS") Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/1564022349-17338-1-git-send-email-zhenzhong.duan@oracle.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--arch/x86/kernel/cpu/bugs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index a5cde748cf76..c5690440fbd4 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -1196,7 +1196,7 @@ static ssize_t l1tf_show_state(char *buf)
static ssize_t mds_show_state(char *buf)
{
- if (!hypervisor_is_type(X86_HYPER_NATIVE)) {
+ if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) {
return sprintf(buf, "%s; SMT Host state unknown\n",
mds_strings[mds_mitigation]);
}