Skip to content

Commit 7b75782

Browse files
leitaoIngo Molnar
authored andcommitted
x86/bugs: Rename CONFIG_SLS => CONFIG_MITIGATION_SLS
Step 6/10 of the namespace unification of CPU mitigations related Kconfig options. Suggested-by: Josh Poimboeuf <[email protected]> Signed-off-by: Breno Leitao <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Acked-by: Josh Poimboeuf <[email protected]> Cc: Linus Torvalds <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent aefb2f2 commit 7b75782

File tree

7 files changed

+11
-10
lines changed

7 files changed

+11
-10
lines changed

arch/x86/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2577,7 +2577,7 @@ config CPU_SRSO
25772577
help
25782578
Enable the SRSO mitigation needed on AMD Zen1-4 machines.
25792579

2580-
config SLS
2580+
config MITIGATION_SLS
25812581
bool "Mitigate Straight-Line-Speculation"
25822582
depends on CC_HAS_SLS && X86_64
25832583
select OBJTOOL if HAVE_OBJTOOL

arch/x86/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ ifdef CONFIG_MITIGATION_RETPOLINE
205205
endif
206206
endif
207207

208-
ifdef CONFIG_SLS
208+
ifdef CONFIG_MITIGATION_SLS
209209
KBUILD_CFLAGS += -mharden-sls=all
210210
endif
211211

arch/x86/include/asm/linkage.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
#if defined(CONFIG_RETHUNK) && !defined(__DISABLE_EXPORTS) && !defined(BUILD_VDSO)
4444
#define RET jmp __x86_return_thunk
4545
#else /* CONFIG_MITIGATION_RETPOLINE */
46-
#ifdef CONFIG_SLS
46+
#ifdef CONFIG_MITIGATION_SLS
4747
#define RET ret; int3
4848
#else
4949
#define RET ret
@@ -55,7 +55,7 @@
5555
#if defined(CONFIG_RETHUNK) && !defined(__DISABLE_EXPORTS) && !defined(BUILD_VDSO)
5656
#define ASM_RET "jmp __x86_return_thunk\n\t"
5757
#else /* CONFIG_MITIGATION_RETPOLINE */
58-
#ifdef CONFIG_SLS
58+
#ifdef CONFIG_MITIGATION_SLS
5959
#define ASM_RET "ret; int3\n\t"
6060
#else
6161
#define ASM_RET "ret\n\t"

arch/x86/kernel/alternative.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -708,8 +708,8 @@ static int patch_retpoline(void *addr, struct insn *insn, u8 *bytes)
708708
/*
709709
* The compiler is supposed to EMIT an INT3 after every unconditional
710710
* JMP instruction due to AMD BTC. However, if the compiler is too old
711-
* or SLS isn't enabled, we still need an INT3 after indirect JMPs
712-
* even on Intel.
711+
* or MITIGATION_SLS isn't enabled, we still need an INT3 after
712+
* indirect JMPs even on Intel.
713713
*/
714714
if (op == JMP32_INSN_OPCODE && i < insn->length)
715715
bytes[i++] = INT3_INSN_OPCODE;

arch/x86/kernel/ftrace.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,8 @@ union ftrace_op_code_union {
307307
} __attribute__((packed));
308308
};
309309

310-
#define RET_SIZE (IS_ENABLED(CONFIG_MITIGATION_RETPOLINE) ? 5 : 1 + IS_ENABLED(CONFIG_SLS))
310+
#define RET_SIZE \
311+
(IS_ENABLED(CONFIG_MITIGATION_RETPOLINE) ? 5 : 1 + IS_ENABLED(CONFIG_MITIGATION_SLS))
311312

312313
static unsigned long
313314
create_trampoline(struct ftrace_ops *ops, unsigned int *tramp_size)

arch/x86/net/bpf_jit_comp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ static void emit_indirect_jump(u8 **pprog, int reg, u8 *ip)
469469
emit_jump(&prog, &__x86_indirect_thunk_array[reg], ip);
470470
} else {
471471
EMIT2(0xFF, 0xE0 + reg); /* jmp *%\reg */
472-
if (IS_ENABLED(CONFIG_MITIGATION_RETPOLINE) || IS_ENABLED(CONFIG_SLS))
472+
if (IS_ENABLED(CONFIG_MITIGATION_RETPOLINE) || IS_ENABLED(CONFIG_MITIGATION_SLS))
473473
EMIT1(0xCC); /* int3 */
474474
}
475475

@@ -484,7 +484,7 @@ static void emit_return(u8 **pprog, u8 *ip)
484484
emit_jump(&prog, x86_return_thunk, ip);
485485
} else {
486486
EMIT1(0xC3); /* ret */
487-
if (IS_ENABLED(CONFIG_SLS))
487+
if (IS_ENABLED(CONFIG_MITIGATION_SLS))
488488
EMIT1(0xCC); /* int3 */
489489
}
490490

scripts/Makefile.lib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ endif
264264
objtool-args-$(CONFIG_UNWINDER_ORC) += --orc
265265
objtool-args-$(CONFIG_MITIGATION_RETPOLINE) += --retpoline
266266
objtool-args-$(CONFIG_RETHUNK) += --rethunk
267-
objtool-args-$(CONFIG_SLS) += --sls
267+
objtool-args-$(CONFIG_MITIGATION_SLS) += --sls
268268
objtool-args-$(CONFIG_STACK_VALIDATION) += --stackval
269269
objtool-args-$(CONFIG_HAVE_STATIC_CALL_INLINE) += --static-call
270270
objtool-args-$(CONFIG_HAVE_UACCESS_VALIDATION) += --uaccess

0 commit comments

Comments
 (0)