]>
Commit | Line | Data |
---|---|---|
6fa88700 GKH |
1 | From d6a87300a6f1cba5faabcdb94d54fbef150d8e79 Mon Sep 17 00:00:00 2001 |
2 | From: Josh Poimboeuf <jpoimboe@redhat.com> | |
3 | Date: Tue, 2 Apr 2019 10:00:51 -0500 | |
4 | Subject: [PATCH 66/76] x86/speculation/mds: Add SMT warning message | |
5 | ||
6 | commit 39226ef02bfb43248b7db12a4fdccb39d95318e3 upstream. | |
7 | ||
8 | MDS is vulnerable with SMT. Make that clear with a one-time printk | |
9 | whenever SMT first gets enabled. | |
10 | ||
11 | Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> | |
12 | Signed-off-by: Thomas Gleixner <tglx@linutronix.de> | |
13 | Reviewed-by: Tyler Hicks <tyhicks@canonical.com> | |
14 | Acked-by: Jiri Kosina <jkosina@suse.cz> | |
15 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | |
16 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
17 | --- | |
18 | arch/x86/kernel/cpu/bugs.c | 8 ++++++++ | |
19 | 1 file changed, 8 insertions(+) | |
20 | ||
21 | diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c | |
22 | index a725105a49d1..6a3fcacbb9a0 100644 | |
23 | --- a/arch/x86/kernel/cpu/bugs.c | |
24 | +++ b/arch/x86/kernel/cpu/bugs.c | |
25 | @@ -667,6 +667,9 @@ static void update_indir_branch_cond(void) | |
26 | static_branch_disable(&switch_to_cond_stibp); | |
27 | } | |
28 | ||
29 | +#undef pr_fmt | |
30 | +#define pr_fmt(fmt) fmt | |
31 | + | |
32 | /* Update the static key controlling the MDS CPU buffer clear in idle */ | |
33 | static void update_mds_branch_idle(void) | |
34 | { | |
35 | @@ -687,6 +690,8 @@ static void update_mds_branch_idle(void) | |
36 | static_branch_disable(&mds_idle_clear); | |
37 | } | |
38 | ||
39 | +#define MDS_MSG_SMT "MDS CPU bug present and SMT on, data leak possible. See https://www.kernel.org/doc/html/latest/admin-guide/hw-vuln/mds.html for more details.\n" | |
40 | + | |
41 | void arch_smt_update(void) | |
42 | { | |
43 | /* Enhanced IBRS implies STIBP. No update required. */ | |
44 | @@ -710,6 +715,8 @@ void arch_smt_update(void) | |
45 | switch (mds_mitigation) { | |
46 | case MDS_MITIGATION_FULL: | |
47 | case MDS_MITIGATION_VMWERV: | |
48 | + if (sched_smt_active() && !boot_cpu_has(X86_BUG_MSBDS_ONLY)) | |
49 | + pr_warn_once(MDS_MSG_SMT); | |
50 | update_mds_branch_idle(); | |
51 | break; | |
52 | case MDS_MITIGATION_OFF: | |
53 | @@ -1139,6 +1146,7 @@ static int __init l1tf_cmdline(char *str) | |
54 | early_param("l1tf", l1tf_cmdline); | |
55 | ||
56 | #undef pr_fmt | |
57 | +#define pr_fmt(fmt) fmt | |
58 | ||
59 | #ifdef CONFIG_SYSFS | |
60 | ||
61 | -- | |
62 | 2.21.0 | |
63 |