Skip to content

Commit

Permalink
x86/speculation/mds: Add 'mitigations=' support for MDS
Browse files Browse the repository at this point in the history
commit 5c14068f87d04adc73ba3f41c2a303d3c3d1fa12 upstream.

Add MDS to the new 'mitigations=' cmdline option.

Signed-off-by: Josh Poimboeuf <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Signed-off-by: Ben Hutchings <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
jpoimboe authored and gregkh committed May 14, 2019
1 parent 1709284 commit 025b9cf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2488,6 +2488,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
spectre_v2_user=off [X86]
spec_store_bypass_disable=off [X86]
l1tf=off [X86]
mds=off [X86]

auto (default)
Mitigate all CPU vulnerabilities, but leave SMT
Expand All @@ -2502,6 +2503,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
if needed. This is for users who always want to
be fully mitigated, even if it means losing SMT.
Equivalent to: l1tf=flush,nosmt [X86]
mds=full,nosmt [X86]

mminit_loglevel=
[KNL] When CONFIG_DEBUG_MEMORY_INIT is set, this
Expand Down
5 changes: 3 additions & 2 deletions arch/x86/kernel/cpu/bugs.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ static const char * const mds_strings[] = {

static void __init mds_select_mitigation(void)
{
if (!boot_cpu_has_bug(X86_BUG_MDS)) {
if (!boot_cpu_has_bug(X86_BUG_MDS) || cpu_mitigations_off()) {
mds_mitigation = MDS_MITIGATION_OFF;
return;
}
Expand All @@ -241,7 +241,8 @@ static void __init mds_select_mitigation(void)

static_branch_enable(&mds_user_clear);

if (mds_nosmt && !boot_cpu_has(X86_BUG_MSBDS_ONLY))
if (!boot_cpu_has(X86_BUG_MSBDS_ONLY) &&
(mds_nosmt || cpu_mitigations_auto_nosmt()))
cpu_smt_disable(false);
}

Expand Down

0 comments on commit 025b9cf

Please sign in to comment.