]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
x86/bugs: Replace CONFIG_SPECTRE_BHI_{ON,OFF} with CONFIG_MITIGATION_SPECTRE_BHI
authorJosh Poimboeuf <jpoimboe@kernel.org>
Thu, 11 Apr 2024 05:40:51 +0000 (22:40 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Apr 2024 09:15:17 +0000 (11:15 +0200)
commit 4f511739c54b549061993b53fc0380f48dfca23b upstream.

For consistency with the other CONFIG_MITIGATION_* options, replace the
CONFIG_SPECTRE_BHI_{ON,OFF} options with a single
CONFIG_MITIGATION_SPECTRE_BHI option.

[ mingo: Fix ]

Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Sean Christopherson <seanjc@google.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Nikolay Borisov <nik.borisov@suse.com>
Link: https://lore.kernel.org/r/3833812ea63e7fdbe36bf8b932e63f70d18e2a2a.1712813475.git.jpoimboe@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/Kconfig
arch/x86/kernel/cpu/bugs.c

index ec740d5263d8b743db7983f6e5694bbd7a85a7c1..c29b024b907cf8d670ebb8b19685d5011f812827 100644 (file)
@@ -2505,27 +2505,16 @@ config MITIGATION_RFDS
          stored in floating point, vector and integer registers.
          See also <file:Documentation/admin-guide/hw-vuln/reg-file-data-sampling.rst>
 
-choice
-       prompt "Clear branch history"
+config MITIGATION_SPECTRE_BHI
+       bool "Mitigate Spectre-BHB (Branch History Injection)"
        depends on CPU_SUP_INTEL
-       default SPECTRE_BHI_ON
+       default y
        help
          Enable BHI mitigations. BHI attacks are a form of Spectre V2 attacks
          where the branch history buffer is poisoned to speculatively steer
          indirect branches.
          See <file:Documentation/admin-guide/hw-vuln/spectre.rst>
 
-config SPECTRE_BHI_ON
-       bool "on"
-       help
-         Equivalent to setting spectre_bhi=on command line parameter.
-config SPECTRE_BHI_OFF
-       bool "off"
-       help
-         Equivalent to setting spectre_bhi=off command line parameter.
-
-endchoice
-
 endif
 
 config ARCH_HAS_ADD_PAGES
index 119ae8db01995110c85f19aed0d1abca7fa7d06c..b30b32b288dd473169d343654ef8e472aea0956f 100644 (file)
@@ -1605,7 +1605,7 @@ enum bhi_mitigations {
 };
 
 static enum bhi_mitigations bhi_mitigation __ro_after_init =
-       IS_ENABLED(CONFIG_SPECTRE_BHI_ON) ? BHI_MITIGATION_ON : BHI_MITIGATION_OFF;
+       IS_ENABLED(CONFIG_MITIGATION_SPECTRE_BHI) ? BHI_MITIGATION_ON : BHI_MITIGATION_OFF;
 
 static int __init spectre_bhi_parse_cmdline(char *str)
 {