]> git.dujemihanovic.xyz Git - linux.git/commitdiff
x86/bugs: Remove CONFIG_BHI_MITIGATION_AUTO and spectre_bhi=auto
authorJosh Poimboeuf <jpoimboe@kernel.org>
Thu, 11 Apr 2024 05:40:50 +0000 (22:40 -0700)
committerIngo Molnar <mingo@kernel.org>
Fri, 12 Apr 2024 10:05:54 +0000 (12:05 +0200)
Unlike most other mitigations' "auto" options, spectre_bhi=auto only
mitigates newer systems, which is confusing and not particularly useful.

Remove it.

Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Nikolay Borisov <nik.borisov@suse.com>
Cc: Sean Christopherson <seanjc@google.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/412e9dc87971b622bbbaf64740ebc1f140bff343.1712813475.git.jpoimboe@kernel.org
Documentation/admin-guide/hw-vuln/spectre.rst
Documentation/admin-guide/kernel-parameters.txt
arch/x86/Kconfig
arch/x86/kernel/cpu/bugs.c

index 5a39acf824835dc7ca748898881938a0a9c8d9cf..25a04cda4c2c054864fa1792d98d9f095ea56a17 100644 (file)
@@ -669,10 +669,6 @@ kernel command line.
                        needed.
                off
                        Disable the mitigation.
-               auto
-                       Enable the HW mitigation if needed, but
-                       *don't* enable the SW mitigation except for KVM.
-                       The system may be vulnerable.
 
 For spectre_v2_user see Documentation/admin-guide/kernel-parameters.txt
 
index a3874cc97892d949751e68418dcc09a53d39920e..902ecd92a29fbe83df18d32d1a8fe652c8277132 100644 (file)
                        on   - (default) Enable the HW or SW mitigation
                               as needed.
                        off  - Disable the mitigation.
-                       auto - Enable the HW mitigation if needed, but
-                              *don't* enable the SW mitigation except
-                              for KVM.  The system may be vulnerable.
 
        spectre_v2=     [X86,EARLY] Control mitigation of Spectre variant 2
                        (indirect branch speculation) vulnerability.
index 10a6251f58f3e0789cf5507322b92d92a87bc2eb..b63b6767a63dc6fcca33766e0b43010fce6afe7d 100644 (file)
@@ -2651,11 +2651,6 @@ config SPECTRE_BHI_OFF
        bool "off"
        help
          Equivalent to setting spectre_bhi=off command line parameter.
-config SPECTRE_BHI_AUTO
-       bool "auto"
-       depends on BROKEN
-       help
-         Equivalent to setting spectre_bhi=auto command line parameter.
 
 endchoice
 
index 9eeb60f5fbb356c187ade220c88b3e2768a7257c..6af4780a18ed33d4bc073b6b8e160529ac9bccc5 100644 (file)
@@ -1625,13 +1625,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)
 {
@@ -1642,8 +1639,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);
 
@@ -1673,9 +1668,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");