]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
x86/speculation/mds: Add 'mitigations=' support for MDS
authorJosh Poimboeuf <jpoimboe@redhat.com>
Wed, 17 Apr 2019 21:39:02 +0000 (16:39 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 May 2019 17:45:16 +0000 (19:45 +0200)
commit 5c14068f87d04adc73ba3f41c2a303d3c3d1fa12 upstream.

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

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
[bwh: Backported to 4.4:
 - Drop the auto,nosmt option, which we can't support
 - Adjust filenames, context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Documentation/kernel-parameters.txt
arch/x86/kernel/cpu/bugs.c

index 647b988f6f5bd1740662e782ad8fa12ef1d18dda..175d57049168b9c3baf4deb93950107f3e38c5b5 100644 (file)
@@ -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
index 3db79a6a1542d65f97fa75167574f732fc86a460..95b15c293077ca3a9b491da84c796785c1c10c8b 100644 (file)
@@ -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;
        }