]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
x86/bugs: Rename CONFIG_SLS => CONFIG_MITIGATION_SLS
authorBreno Leitao <leitao@debian.org>
Tue, 21 Nov 2023 16:07:33 +0000 (08:07 -0800)
committerIngo Molnar <mingo@kernel.org>
Wed, 10 Jan 2024 09:52:28 +0000 (10:52 +0100)
Step 6/10 of the namespace unification of CPU mitigations related Kconfig options.

Suggested-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/20231121160740.1249350-7-leitao@debian.org
arch/x86/Kconfig
arch/x86/Makefile
arch/x86/include/asm/linkage.h
arch/x86/kernel/alternative.c
arch/x86/kernel/ftrace.c
arch/x86/net/bpf_jit_comp.c
scripts/Makefile.lib

index 2a3ebd679b0e1b195c9618287f812d0a768bc8e4..ba4546556fc550352321ea804f75f4505ee03424 100644 (file)
@@ -2577,7 +2577,7 @@ config CPU_SRSO
        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
index b8d23ed059fb4cbda1b878c8a8ca9d76f527e4a5..5ce8c30e77010f414d3a335094975bda5236b6bd 100644 (file)
@@ -205,7 +205,7 @@ ifdef CONFIG_MITIGATION_RETPOLINE
   endif
 endif
 
-ifdef CONFIG_SLS
+ifdef CONFIG_MITIGATION_SLS
   KBUILD_CFLAGS += -mharden-sls=all
 endif
 
index c5165204c66f0aac7127fce3d3b59bfbfde5bf7e..09e2d026df333b786b21e3539c109e1143d38ef2 100644 (file)
@@ -43,7 +43,7 @@
 #if defined(CONFIG_RETHUNK) && !defined(__DISABLE_EXPORTS) && !defined(BUILD_VDSO)
 #define RET    jmp __x86_return_thunk
 #else /* CONFIG_MITIGATION_RETPOLINE */
-#ifdef CONFIG_SLS
+#ifdef CONFIG_MITIGATION_SLS
 #define RET    ret; int3
 #else
 #define RET    ret
@@ -55,7 +55,7 @@
 #if defined(CONFIG_RETHUNK) && !defined(__DISABLE_EXPORTS) && !defined(BUILD_VDSO)
 #define ASM_RET        "jmp __x86_return_thunk\n\t"
 #else /* CONFIG_MITIGATION_RETPOLINE */
-#ifdef CONFIG_SLS
+#ifdef CONFIG_MITIGATION_SLS
 #define ASM_RET        "ret; int3\n\t"
 #else
 #define ASM_RET        "ret\n\t"
index 08c182f5a0f4d5d9ff4932edc038ccffcce164a7..f5442d0d2ee9bbe0671837890a0884b21cbfd6e8 100644 (file)
@@ -708,8 +708,8 @@ static int patch_retpoline(void *addr, struct insn *insn, u8 *bytes)
        /*
         * The compiler is supposed to EMIT an INT3 after every unconditional
         * JMP instruction due to AMD BTC. However, if the compiler is too old
-        * or SLS isn't enabled, we still need an INT3 after indirect JMPs
-        * even on Intel.
+        * or MITIGATION_SLS isn't enabled, we still need an INT3 after
+        * indirect JMPs even on Intel.
         */
        if (op == JMP32_INSN_OPCODE && i < insn->length)
                bytes[i++] = INT3_INSN_OPCODE;
index 93bc52d4a472da6946f45d87595ee8c163290e48..70139d9d2e017316f7e7d015b52aeb86f7f1c580 100644 (file)
@@ -307,7 +307,8 @@ union ftrace_op_code_union {
        } __attribute__((packed));
 };
 
-#define RET_SIZE       (IS_ENABLED(CONFIG_MITIGATION_RETPOLINE) ? 5 : 1 + IS_ENABLED(CONFIG_SLS))
+#define RET_SIZE \
+       (IS_ENABLED(CONFIG_MITIGATION_RETPOLINE) ? 5 : 1 + IS_ENABLED(CONFIG_MITIGATION_SLS))
 
 static unsigned long
 create_trampoline(struct ftrace_ops *ops, unsigned int *tramp_size)
index ad1396b1df25337d0607d4f227233dcbb97829dc..63b7aa48793e386855530b72fa77cd321e9e1186 100644 (file)
@@ -469,7 +469,7 @@ static void emit_indirect_jump(u8 **pprog, int reg, u8 *ip)
                        emit_jump(&prog, &__x86_indirect_thunk_array[reg], ip);
        } else {
                EMIT2(0xFF, 0xE0 + reg);        /* jmp *%\reg */
-               if (IS_ENABLED(CONFIG_MITIGATION_RETPOLINE) || IS_ENABLED(CONFIG_SLS))
+               if (IS_ENABLED(CONFIG_MITIGATION_RETPOLINE) || IS_ENABLED(CONFIG_MITIGATION_SLS))
                        EMIT1(0xCC);            /* int3 */
        }
 
@@ -484,7 +484,7 @@ static void emit_return(u8 **pprog, u8 *ip)
                emit_jump(&prog, x86_return_thunk, ip);
        } else {
                EMIT1(0xC3);            /* ret */
-               if (IS_ENABLED(CONFIG_SLS))
+               if (IS_ENABLED(CONFIG_MITIGATION_SLS))
                        EMIT1(0xCC);    /* int3 */
        }
 
index 615f2612a7efb5662b8a3f1cd237b06bf6dcacdb..b272ca64cd7582ad5bea76310e37e898b0cf2161 100644 (file)
@@ -264,7 +264,7 @@ endif
 objtool-args-$(CONFIG_UNWINDER_ORC)                    += --orc
 objtool-args-$(CONFIG_MITIGATION_RETPOLINE)            += --retpoline
 objtool-args-$(CONFIG_RETHUNK)                         += --rethunk
-objtool-args-$(CONFIG_SLS)                             += --sls
+objtool-args-$(CONFIG_MITIGATION_SLS)                  += --sls
 objtool-args-$(CONFIG_STACK_VALIDATION)                        += --stackval
 objtool-args-$(CONFIG_HAVE_STATIC_CALL_INLINE)         += --static-call
 objtool-args-$(CONFIG_HAVE_UACCESS_VALIDATION)         += --uaccess