]> git.itanic.dy.fi Git - linux-stable/blobdiff - arch/x86/kernel/cpu/bugs.c
x86/bugs: Remove CONFIG_BHI_MITIGATION_AUTO and spectre_bhi=auto
[linux-stable] / arch / x86 / kernel / cpu / bugs.c
index 5883fa2e1f704aba59bdec609800d92de34a48fb..9bcc898dcc757d3d1967332163889dbc0aa7b779 100644 (file)
@@ -1624,13 +1624,10 @@ static bool __init spec_ctrl_bhi_dis(void)
 enum bhi_mitigations {
        BHI_MITIGATION_OFF,
        BHI_MITIGATION_ON,
-       BHI_MITIGATION_AUTO,
 };
 
 static enum bhi_mitigations bhi_mitigation __ro_after_init =
-       IS_ENABLED(CONFIG_SPECTRE_BHI_ON)  ? BHI_MITIGATION_ON  :
-       IS_ENABLED(CONFIG_SPECTRE_BHI_OFF) ? BHI_MITIGATION_OFF :
-                                            BHI_MITIGATION_AUTO;
+       IS_ENABLED(CONFIG_SPECTRE_BHI_ON) ? BHI_MITIGATION_ON : BHI_MITIGATION_OFF;
 
 static int __init spectre_bhi_parse_cmdline(char *str)
 {
@@ -1641,8 +1638,6 @@ static int __init spectre_bhi_parse_cmdline(char *str)
                bhi_mitigation = BHI_MITIGATION_OFF;
        else if (!strcmp(str, "on"))
                bhi_mitigation = BHI_MITIGATION_ON;
-       else if (!strcmp(str, "auto"))
-               bhi_mitigation = BHI_MITIGATION_AUTO;
        else
                pr_err("Ignoring unknown spectre_bhi option (%s)", str);
 
@@ -1672,9 +1667,6 @@ static void __init bhi_select_mitigation(void)
        setup_force_cpu_cap(X86_FEATURE_CLEAR_BHB_LOOP_ON_VMEXIT);
        pr_info("Spectre BHI mitigation: SW BHB clearing on vm exit\n");
 
-       if (bhi_mitigation == BHI_MITIGATION_AUTO)
-               return;
-
        /* Mitigate syscalls when the mitigation is forced =on */
        setup_force_cpu_cap(X86_FEATURE_CLEAR_BHB_LOOP);
        pr_info("Spectre BHI mitigation: SW BHB clearing on syscall\n");