x86: Add straight-line-speculation mitigation
[platform/kernel/linux-rpi.git] / arch / x86 / Kconfig
index 819f8c2..d02b04d 100644 (file)
@@ -468,6 +468,18 @@ config RETPOLINE
          branches. Requires a compiler with -mindirect-branch=thunk-extern
          support for full protection. The kernel may run slower.
 
+config CC_HAS_SLS
+       def_bool $(cc-option,-mharden-sls=all)
+
+config SLS
+       bool "Mitigate Straight-Line-Speculation"
+       depends on CC_HAS_SLS && X86_64
+       default n
+       help
+         Compile the kernel with straight-line-speculation options to guard
+         against straight line speculation. The kernel image might be slightly
+         larger.
+
 config X86_CPU_RESCTRL
        bool "x86 CPU resource control support"
        depends on X86 && (CPU_SUP_INTEL || CPU_SUP_AMD)