Skip to content

Commit

Permalink
x86/speculation/mds: Print SMT vulnerable on MSBDS with mitigations off
Browse files Browse the repository at this point in the history
This code is only for CPUs which are affected by MSBDS, but are *not*
affected by the other two MDS issues.

For such CPUs, enabling the mds_idle_clear mitigation is enough to
mitigate SMT.

However if user boots with 'mds=off' and still has SMT enabled, we should
not report that SMT is mitigated:

$cat /sys//devices/system/cpu/vulnerabilities/mds
Vulnerable; SMT mitigated

But rather:
Vulnerable; SMT vulnerable

Signed-off-by: Konrad Rzeszutek Wilk <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Reviewed-by: Tyler Hicks <[email protected]>
Reviewed-by: Josh Poimboeuf <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
  • Loading branch information
konradwilk authored and KAGA-KOKO committed Apr 17, 2019
1 parent cae5ec3 commit e2c3c94
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/x86/kernel/cpu/bugs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1204,7 +1204,8 @@ static ssize_t mds_show_state(char *buf)

if (boot_cpu_has(X86_BUG_MSBDS_ONLY)) {
return sprintf(buf, "%s; SMT %s\n", mds_strings[mds_mitigation],
sched_smt_active() ? "mitigated" : "disabled");
(mds_mitigation == MDS_MITIGATION_OFF ? "vulnerable" :
sched_smt_active() ? "mitigated" : "disabled"));
}

return sprintf(buf, "%s; SMT %s\n", mds_strings[mds_mitigation],
Expand Down

0 comments on commit e2c3c94

Please sign in to comment.