Merge tag 'nativebhi' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
[sfrench/cifs-2.6.git] / arch / x86 / Kconfig
index 39886bab943a88b3a8262a733a7e2e82269934f8..10a6251f58f3e0789cf5507322b92d92a87bc2eb 100644 (file)
@@ -2439,6 +2439,8 @@ config USE_X86_SEG_SUPPORT
        # with named address spaces - see GCC PR sanitizer/111736.
        #
        depends on !KASAN
+       # -fsanitize=thread (KCSAN) is also incompatible.
+       depends on !KCSAN
 
 config CC_HAS_SLS
        def_bool $(cc-option,-mharden-sls=all)
@@ -2631,6 +2633,32 @@ 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"
+       depends on CPU_SUP_INTEL
+       default SPECTRE_BHI_ON
+       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.
+config SPECTRE_BHI_AUTO
+       bool "auto"
+       depends on BROKEN
+       help
+         Equivalent to setting spectre_bhi=auto command line parameter.
+
+endchoice
+
 endif
 
 config ARCH_HAS_ADD_PAGES