]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
x86/speculation/mds: Check for the right microcode before setting mitigation
authorKanth Ghatraju <kanth.ghatraju@oracle.com>
Tue, 21 May 2019 21:55:18 +0000 (17:55 -0400)
committerBrian Maly <brian.maly@oracle.com>
Wed, 22 May 2019 14:03:45 +0000 (10:03 -0400)
With the addition of new mitigation for idle, need to check the availability
of microcode when mds=idle. The fix is to take the check out of the if
statement.

Orabug: 29797118
Signed-off-by: Kanth Ghatraju <kanth.ghatraju@oracle.com>
Reviewed-by: Mihai Carabas <mihai.carabas@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
arch/x86/kernel/cpu/bugs_64.c

index d6f796c37540b997ff2671e0c7cc71f356b10150..17ca33fac5dcc0572d7b2a0c0307d5ce2c99896d 100644 (file)
@@ -1391,6 +1391,11 @@ static void mds_select_mitigation(void)
                return;
        }
 
+       if (!boot_cpu_has(X86_FEATURE_MD_CLEAR)) {
+               mds_mitigation = MDS_MITIGATION_VMWERV;
+               return;
+       }
+
         ret = cmdline_find_option(boot_command_line, "mds", arg,
                                   sizeof(arg));
         if (ret > 0) {
@@ -1405,8 +1410,6 @@ static void mds_select_mitigation(void)
        }
 
        if (mds_mitigation == MDS_MITIGATION_FULL) {
-               if (!boot_cpu_has(X86_FEATURE_MD_CLEAR))
-                       mds_mitigation = MDS_MITIGATION_VMWERV;
 
                static_branch_enable(&mds_user_clear);