From: Josh Poimboeuf Date: Wed, 17 Apr 2019 21:39:02 +0000 (-0500) Subject: x86/speculation/mds: Add 'mitigations=' support for MDS X-Git-Tag: v4.4.180~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3092ad5c4f2ed6925847273a65c5598a73ee88d8;p=thirdparty%2Fkernel%2Fstable.git x86/speculation/mds: Add 'mitigations=' support for MDS commit 5c14068f87d04adc73ba3f41c2a303d3c3d1fa12 upstream. Add MDS to the new 'mitigations=' cmdline option. Signed-off-by: Josh Poimboeuf Signed-off-by: Thomas Gleixner [bwh: Backported to 4.4: - Drop the auto,nosmt option, which we can't support - Adjust filenames, context] Signed-off-by: Ben Hutchings Signed-off-by: Greg Kroah-Hartman --- diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 647b988f6f5bd..175d57049168b 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -2187,6 +2187,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted. nospectre_v2 [X86] spectre_v2_user=off [X86] spec_store_bypass_disable=off [X86] + mds=off [X86] auto (default) Mitigate all CPU vulnerabilities, but leave SMT diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index 3db79a6a1542d..95b15c293077c 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -221,7 +221,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; }