]>
Commit | Line | Data |
---|---|---|
6fa88700 GKH |
1 | From ce0288e1234af1264193e40b79d0925fc7c989b9 Mon Sep 17 00:00:00 2001 |
2 | From: Thomas Gleixner <tglx@linutronix.de> | |
3 | Date: Sun, 25 Nov 2018 19:33:40 +0100 | |
4 | Subject: [PATCH 32/76] x86/l1tf: Show actual SMT state | |
5 | ||
6 | commit 130d6f946f6f2a972ee3ec8540b7243ab99abe97 upstream. | |
7 | ||
8 | Use the now exposed real SMT state, not the SMT sysfs control knob | |
9 | state. This reflects the state of the system when the mitigation status is | |
10 | queried. | |
11 | ||
12 | This does not change the warning in the VMX launch code. There the | |
13 | dependency on the control knob makes sense because siblings could be | |
14 | brought online anytime after launching the VM. | |
15 | ||
16 | Signed-off-by: Thomas Gleixner <tglx@linutronix.de> | |
17 | Reviewed-by: Ingo Molnar <mingo@kernel.org> | |
18 | Cc: Peter Zijlstra <peterz@infradead.org> | |
19 | Cc: Andy Lutomirski <luto@kernel.org> | |
20 | Cc: Linus Torvalds <torvalds@linux-foundation.org> | |
21 | Cc: Jiri Kosina <jkosina@suse.cz> | |
22 | Cc: Tom Lendacky <thomas.lendacky@amd.com> | |
23 | Cc: Josh Poimboeuf <jpoimboe@redhat.com> | |
24 | Cc: Andrea Arcangeli <aarcange@redhat.com> | |
25 | Cc: David Woodhouse <dwmw@amazon.co.uk> | |
26 | Cc: Tim Chen <tim.c.chen@linux.intel.com> | |
27 | Cc: Andi Kleen <ak@linux.intel.com> | |
28 | Cc: Dave Hansen <dave.hansen@intel.com> | |
29 | Cc: Casey Schaufler <casey.schaufler@intel.com> | |
30 | Cc: Asit Mallick <asit.k.mallick@intel.com> | |
31 | Cc: Arjan van de Ven <arjan@linux.intel.com> | |
32 | Cc: Jon Masters <jcm@redhat.com> | |
33 | Cc: Waiman Long <longman9394@gmail.com> | |
34 | Cc: Greg KH <gregkh@linuxfoundation.org> | |
35 | Cc: Dave Stewart <david.c.stewart@intel.com> | |
36 | Cc: Kees Cook <keescook@chromium.org> | |
37 | Link: https://lkml.kernel.org/r/20181125185004.613357354@linutronix.de | |
38 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | |
39 | Signed-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 | ||
44 | diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c | |
45 | index 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 | -- | |
66 | 2.21.0 | |
67 |