]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - queue-4.9/0032-x86-l1tf-Show-actual-SMT-state.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / queue-4.9 / 0032-x86-l1tf-Show-actual-SMT-state.patch
CommitLineData
6fa88700
GKH
1From ce0288e1234af1264193e40b79d0925fc7c989b9 Mon Sep 17 00:00:00 2001
2From: Thomas Gleixner <tglx@linutronix.de>
3Date: Sun, 25 Nov 2018 19:33:40 +0100
4Subject: [PATCH 32/76] x86/l1tf: Show actual SMT state
5
6commit 130d6f946f6f2a972ee3ec8540b7243ab99abe97 upstream.
7
8Use the now exposed real SMT state, not the SMT sysfs control knob
9state. This reflects the state of the system when the mitigation status is
10queried.
11
12This does not change the warning in the VMX launch code. There the
13dependency on the control knob makes sense because siblings could be
14brought online anytime after launching the VM.
15
16Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
17Reviewed-by: Ingo Molnar <mingo@kernel.org>
18Cc: Peter Zijlstra <peterz@infradead.org>
19Cc: Andy Lutomirski <luto@kernel.org>
20Cc: Linus Torvalds <torvalds@linux-foundation.org>
21Cc: Jiri Kosina <jkosina@suse.cz>
22Cc: Tom Lendacky <thomas.lendacky@amd.com>
23Cc: Josh Poimboeuf <jpoimboe@redhat.com>
24Cc: Andrea Arcangeli <aarcange@redhat.com>
25Cc: David Woodhouse <dwmw@amazon.co.uk>
26Cc: Tim Chen <tim.c.chen@linux.intel.com>
27Cc: Andi Kleen <ak@linux.intel.com>
28Cc: Dave Hansen <dave.hansen@intel.com>
29Cc: Casey Schaufler <casey.schaufler@intel.com>
30Cc: Asit Mallick <asit.k.mallick@intel.com>
31Cc: Arjan van de Ven <arjan@linux.intel.com>
32Cc: Jon Masters <jcm@redhat.com>
33Cc: Waiman Long <longman9394@gmail.com>
34Cc: Greg KH <gregkh@linuxfoundation.org>
35Cc: Dave Stewart <david.c.stewart@intel.com>
36Cc: Kees Cook <keescook@chromium.org>
37Link: https://lkml.kernel.org/r/20181125185004.613357354@linutronix.de
38Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
39Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
40---
41 arch/x86/kernel/cpu/bugs.c | 5 +++--
42 1 file changed, 3 insertions(+), 2 deletions(-)
43
44diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
45index 6ae729caf75e..2ae8cdc8b68c 100644
46--- a/arch/x86/kernel/cpu/bugs.c
47+++ b/arch/x86/kernel/cpu/bugs.c
48@@ -838,13 +838,14 @@ static ssize_t l1tf_show_state(char *buf)
49
50 if (l1tf_vmx_mitigation == VMENTER_L1D_FLUSH_EPT_DISABLED ||
51 (l1tf_vmx_mitigation == VMENTER_L1D_FLUSH_NEVER &&
52- cpu_smt_control == CPU_SMT_ENABLED))
53+ sched_smt_active())) {
54 return sprintf(buf, "%s; VMX: %s\n", L1TF_DEFAULT_MSG,
55 l1tf_vmx_states[l1tf_vmx_mitigation]);
56+ }
57
58 return sprintf(buf, "%s; VMX: %s, SMT %s\n", L1TF_DEFAULT_MSG,
59 l1tf_vmx_states[l1tf_vmx_mitigation],
60- cpu_smt_control == CPU_SMT_ENABLED ? "vulnerable" : "disabled");
61+ sched_smt_active() ? "vulnerable" : "disabled");
62 }
63 #else
64 static ssize_t l1tf_show_state(char *buf)
65--
662.21.0
67