Merge tag 'hardening-v6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees...
[linux-2.6-microblaze.git] / arch / x86 / Kconfig
index 1c4c326..89afacc 100644 (file)
@@ -147,6 +147,7 @@ config X86
        select EDAC_ATOMIC_SCRUB
        select EDAC_SUPPORT
        select GENERIC_CLOCKEVENTS_BROADCAST    if X86_64 || (X86_32 && X86_LOCAL_APIC)
+       select GENERIC_CLOCKEVENTS_BROADCAST_IDLE       if GENERIC_CLOCKEVENTS_BROADCAST
        select GENERIC_CLOCKEVENTS_MIN_ADJUST
        select GENERIC_CMOS_UPDATE
        select GENERIC_CPU_AUTOPROBE
@@ -255,6 +256,7 @@ config X86
        select HAVE_NOINSTR_VALIDATION          if HAVE_OBJTOOL
        select HAVE_OBJTOOL                     if X86_64
        select HAVE_OPTPROBES
+       select HAVE_PAGE_SIZE_4KB
        select HAVE_PCSPKR_PLATFORM
        select HAVE_PERF_EVENTS
        select HAVE_PERF_EVENTS_NMI
@@ -496,6 +498,15 @@ config X86_CPU_RESCTRL
 
          Say N if unsure.
 
+config X86_FRED
+       bool "Flexible Return and Event Delivery"
+       depends on X86_64
+       help
+         When enabled, try to use Flexible Return and Event Delivery
+         instead of the legacy SYSCALL/SYSENTER/IDT architecture for
+         ring transitions and exception/interrupt handling if the
+         system supports.
+
 if X86_32
 config X86_BIGSMP
        bool "Support for big SMP systems with more than 8 CPUs"
@@ -1539,19 +1550,6 @@ config AMD_MEM_ENCRYPT
          This requires an AMD processor that supports Secure Memory
          Encryption (SME).
 
-config AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT
-       bool "Activate AMD Secure Memory Encryption (SME) by default"
-       depends on AMD_MEM_ENCRYPT
-       help
-         Say yes to have system memory encrypted by default if running on
-         an AMD processor that supports Secure Memory Encryption (SME).
-
-         If set to Y, then the encryption of system memory can be
-         deactivated with the mem_encrypt=off command line option.
-
-         If set to N, then the encryption of system memory can be
-         activated with the mem_encrypt=on command line option.
-
 # Common NUMA Features
 config NUMA
        bool "NUMA Memory Allocation and Scheduler Support"
@@ -2114,11 +2112,11 @@ config PHYSICAL_START
        help
          This gives the physical address where the kernel is loaded.
 
-         If kernel is a not relocatable (CONFIG_RELOCATABLE=n) then
-         bzImage will decompress itself to above physical address and
-         run from there. Otherwise, bzImage will run from the address where
-         it has been loaded by the boot loader and will ignore above physical
-         address.
+         If the kernel is not relocatable (CONFIG_RELOCATABLE=n) then bzImage
+         will decompress itself to above physical address and run from there.
+         Otherwise, bzImage will run from the address where it has been loaded
+         by the boot loader. The only exception is if it is loaded below the
+         above physical address, in which case it will relocate itself there.
 
          In normal kdump cases one does not have to set/change this option
          as now bzImage can be compiled as a completely relocatable image
@@ -2434,6 +2432,18 @@ source "kernel/livepatch/Kconfig"
 
 endmenu
 
+config CC_HAS_NAMED_AS
+       def_bool CC_IS_GCC && GCC_VERSION >= 120100
+
+config USE_X86_SEG_SUPPORT
+       def_bool y
+       depends on CC_HAS_NAMED_AS
+       #
+       # -fsanitize=kernel-address (KASAN) is at the moment incompatible
+       # with named address spaces - see GCC PR sanitizer/111736.
+       #
+       depends on !KASAN
+
 config CC_HAS_SLS
        def_bool $(cc-option,-mharden-sls=all)
 
@@ -2465,12 +2475,12 @@ config CALL_PADDING
 
 config FINEIBT
        def_bool y
-       depends on X86_KERNEL_IBT && CFI_CLANG && RETPOLINE
+       depends on X86_KERNEL_IBT && CFI_CLANG && MITIGATION_RETPOLINE
        select CALL_PADDING
 
 config HAVE_CALL_THUNKS
        def_bool y
-       depends on CC_HAS_ENTRY_PADDING && RETHUNK && OBJTOOL
+       depends on CC_HAS_ENTRY_PADDING && MITIGATION_RETHUNK && OBJTOOL
 
 config CALL_THUNKS
        def_bool n
@@ -2492,7 +2502,7 @@ menuconfig SPECULATION_MITIGATIONS
 
 if SPECULATION_MITIGATIONS
 
-config PAGE_TABLE_ISOLATION
+config MITIGATION_PAGE_TABLE_ISOLATION
        bool "Remove the kernel mapping in user mode"
        default y
        depends on (X86_64 || X86_PAE)
@@ -2503,7 +2513,7 @@ config PAGE_TABLE_ISOLATION
 
          See Documentation/arch/x86/pti.rst for more details.
 
-config RETPOLINE
+config MITIGATION_RETPOLINE
        bool "Avoid speculative indirect branches in kernel"
        select OBJTOOL if HAVE_OBJTOOL
        default y
@@ -2513,9 +2523,9 @@ config RETPOLINE
          branches. Requires a compiler with -mindirect-branch=thunk-extern
          support for full protection. The kernel may run slower.
 
-config RETHUNK
+config MITIGATION_RETHUNK
        bool "Enable return-thunks"
-       depends on RETPOLINE && CC_HAS_RETURN_THUNK
+       depends on MITIGATION_RETPOLINE && CC_HAS_RETURN_THUNK
        select OBJTOOL if HAVE_OBJTOOL
        default y if X86_64
        help
@@ -2524,14 +2534,14 @@ config RETHUNK
          Requires a compiler with -mfunction-return=thunk-extern
          support for full protection. The kernel may run slower.
 
-config CPU_UNRET_ENTRY
+config MITIGATION_UNRET_ENTRY
        bool "Enable UNRET on kernel entry"
-       depends on CPU_SUP_AMD && RETHUNK && X86_64
+       depends on CPU_SUP_AMD && MITIGATION_RETHUNK && X86_64
        default y
        help
          Compile the kernel with support for the retbleed=unret mitigation.
 
-config CALL_DEPTH_TRACKING
+config MITIGATION_CALL_DEPTH_TRACKING
        bool "Mitigate RSB underflow with call depth tracking"
        depends on CPU_SUP_INTEL && HAVE_CALL_THUNKS
        select HAVE_DYNAMIC_FTRACE_NO_PATCHABLE
@@ -2551,7 +2561,7 @@ config CALL_DEPTH_TRACKING
 
 config CALL_THUNKS_DEBUG
        bool "Enable call thunks and call depth tracking debugging"
-       depends on CALL_DEPTH_TRACKING
+       depends on MITIGATION_CALL_DEPTH_TRACKING
        select FUNCTION_ALIGNMENT_32B
        default n
        help
@@ -2562,14 +2572,14 @@ config CALL_THUNKS_DEBUG
          Only enable this when you are debugging call thunks as this
          creates a noticeable runtime overhead. If unsure say N.
 
-config CPU_IBPB_ENTRY
+config MITIGATION_IBPB_ENTRY
        bool "Enable IBPB on kernel entry"
        depends on CPU_SUP_AMD && X86_64
        default y
        help
          Compile the kernel with support for the retbleed=ibpb mitigation.
 
-config CPU_IBRS_ENTRY
+config MITIGATION_IBRS_ENTRY
        bool "Enable IBRS on kernel entry"
        depends on CPU_SUP_INTEL && X86_64
        default y
@@ -2578,14 +2588,14 @@ config CPU_IBRS_ENTRY
          This mitigates both spectre_v2 and retbleed at great cost to
          performance.
 
-config CPU_SRSO
+config MITIGATION_SRSO
        bool "Mitigate speculative RAS overflow on AMD"
-       depends on CPU_SUP_AMD && X86_64 && RETHUNK
+       depends on CPU_SUP_AMD && X86_64 && MITIGATION_RETHUNK
        default y
        help
          Enable the SRSO mitigation needed on AMD Zen1-4 machines.
 
-config SLS
+config MITIGATION_SLS
        bool "Mitigate Straight-Line-Speculation"
        depends on CC_HAS_SLS && X86_64
        select OBJTOOL if HAVE_OBJTOOL
@@ -2595,7 +2605,7 @@ config SLS
          against straight line speculation. The kernel image might be slightly
          larger.
 
-config GDS_FORCE_MITIGATION
+config MITIGATION_GDS_FORCE
        bool "Force GDS Mitigation"
        depends on CPU_SUP_INTEL
        default n
@@ -2614,6 +2624,17 @@ config GDS_FORCE_MITIGATION
 
          If in doubt, say N.
 
+config MITIGATION_RFDS
+       bool "RFDS Mitigation"
+       depends on CPU_SUP_INTEL
+       default y
+       help
+         Enable mitigation for Register File Data Sampling (RFDS) by default.
+         RFDS is a hardware vulnerability which affects Intel Atom CPUs. It
+         allows unprivileged speculative access to stale data previously
+         stored in floating point, vector and integer registers.
+         See also <file:Documentation/admin-guide/hw-vuln/reg-file-data-sampling.rst>
+
 endif
 
 config ARCH_HAS_ADD_PAGES