Skip to content

Commit a033eec

Browse files
leitaoIngo Molnar
authored andcommitted
x86/bugs: Rename CONFIG_CPU_SRSO => CONFIG_MITIGATION_SRSO
Step 9/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 1da8d21 commit a033eec

File tree

7 files changed

+17
-17
lines changed

7 files changed

+17
-17
lines changed

arch/x86/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2570,7 +2570,7 @@ config MITIGATION_IBRS_ENTRY
25702570
This mitigates both spectre_v2 and retbleed at great cost to
25712571
performance.
25722572

2573-
config CPU_SRSO
2573+
config MITIGATION_SRSO
25742574
bool "Mitigate speculative RAS overflow on AMD"
25752575
depends on CPU_SUP_AMD && X86_64 && RETHUNK
25762576
default y

arch/x86/include/asm/nospec-branch.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@
212212
*/
213213
.macro VALIDATE_UNRET_END
214214
#if defined(CONFIG_NOINSTR_VALIDATION) && \
215-
(defined(CONFIG_MITIGATION_UNRET_ENTRY) || defined(CONFIG_CPU_SRSO))
215+
(defined(CONFIG_MITIGATION_UNRET_ENTRY) || defined(CONFIG_MITIGATION_SRSO))
216216
ANNOTATE_RETPOLINE_SAFE
217217
nop
218218
#endif
@@ -271,7 +271,7 @@
271271
.Lskip_rsb_\@:
272272
.endm
273273

274-
#if defined(CONFIG_MITIGATION_UNRET_ENTRY) || defined(CONFIG_CPU_SRSO)
274+
#if defined(CONFIG_MITIGATION_UNRET_ENTRY) || defined(CONFIG_MITIGATION_SRSO)
275275
#define CALL_UNTRAIN_RET "call entry_untrain_ret"
276276
#else
277277
#define CALL_UNTRAIN_RET ""
@@ -340,7 +340,7 @@ extern void retbleed_return_thunk(void);
340340
static inline void retbleed_return_thunk(void) {}
341341
#endif
342342

343-
#ifdef CONFIG_CPU_SRSO
343+
#ifdef CONFIG_MITIGATION_SRSO
344344
extern void srso_return_thunk(void);
345345
extern void srso_alias_return_thunk(void);
346346
#else

arch/x86/kernel/cpu/bugs.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2458,7 +2458,7 @@ static void __init srso_select_mitigation(void)
24582458
break;
24592459

24602460
case SRSO_CMD_SAFE_RET:
2461-
if (IS_ENABLED(CONFIG_CPU_SRSO)) {
2461+
if (IS_ENABLED(CONFIG_MITIGATION_SRSO)) {
24622462
/*
24632463
* Enable the return thunk for generated code
24642464
* like ftrace, static_call, etc.
@@ -2478,7 +2478,7 @@ static void __init srso_select_mitigation(void)
24782478
else
24792479
srso_mitigation = SRSO_MITIGATION_SAFE_RET_UCODE_NEEDED;
24802480
} else {
2481-
pr_err("WARNING: kernel not compiled with CPU_SRSO.\n");
2481+
pr_err("WARNING: kernel not compiled with MITIGATION_SRSO.\n");
24822482
}
24832483
break;
24842484

@@ -2494,13 +2494,13 @@ static void __init srso_select_mitigation(void)
24942494
break;
24952495

24962496
case SRSO_CMD_IBPB_ON_VMEXIT:
2497-
if (IS_ENABLED(CONFIG_CPU_SRSO)) {
2497+
if (IS_ENABLED(CONFIG_MITIGATION_SRSO)) {
24982498
if (!boot_cpu_has(X86_FEATURE_ENTRY_IBPB) && has_microcode) {
24992499
setup_force_cpu_cap(X86_FEATURE_IBPB_ON_VMEXIT);
25002500
srso_mitigation = SRSO_MITIGATION_IBPB_ON_VMEXIT;
25012501
}
25022502
} else {
2503-
pr_err("WARNING: kernel not compiled with CPU_SRSO.\n");
2503+
pr_err("WARNING: kernel not compiled with MITIGATION_SRSO.\n");
25042504
}
25052505
break;
25062506
}

arch/x86/kernel/vmlinux.lds.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ SECTIONS
142142
*(.text..__x86.rethunk_untrain)
143143
ENTRY_TEXT
144144

145-
#ifdef CONFIG_CPU_SRSO
145+
#ifdef CONFIG_MITIGATION_SRSO
146146
/*
147147
* See the comment above srso_alias_untrain_ret()'s
148148
* definition.
@@ -508,7 +508,7 @@ INIT_PER_CPU(irq_stack_backing_store);
508508
. = ASSERT((retbleed_return_thunk & 0x3f) == 0, "retbleed_return_thunk not cacheline-aligned");
509509
#endif
510510

511-
#ifdef CONFIG_CPU_SRSO
511+
#ifdef CONFIG_MITIGATION_SRSO
512512
. = ASSERT((srso_safe_ret & 0x3f) == 0, "srso_safe_ret not cacheline-aligned");
513513
/*
514514
* GNU ld cannot do XOR until 2.41.

arch/x86/lib/retpoline.S

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ SYM_CODE_END(__x86_indirect_jump_thunk_array)
138138
*/
139139
.section .text..__x86.return_thunk
140140

141-
#ifdef CONFIG_CPU_SRSO
141+
#ifdef CONFIG_MITIGATION_SRSO
142142

143143
/*
144144
* srso_alias_untrain_ret() and srso_alias_safe_ret() are placed at
@@ -225,10 +225,10 @@ SYM_CODE_END(srso_return_thunk)
225225

226226
#define JMP_SRSO_UNTRAIN_RET "jmp srso_untrain_ret"
227227
#define JMP_SRSO_ALIAS_UNTRAIN_RET "jmp srso_alias_untrain_ret"
228-
#else /* !CONFIG_CPU_SRSO */
228+
#else /* !CONFIG_MITIGATION_SRSO */
229229
#define JMP_SRSO_UNTRAIN_RET "ud2"
230230
#define JMP_SRSO_ALIAS_UNTRAIN_RET "ud2"
231-
#endif /* CONFIG_CPU_SRSO */
231+
#endif /* CONFIG_MITIGATION_SRSO */
232232

233233
#ifdef CONFIG_MITIGATION_UNRET_ENTRY
234234

@@ -316,7 +316,7 @@ SYM_FUNC_END(retbleed_untrain_ret)
316316
#define JMP_RETBLEED_UNTRAIN_RET "ud2"
317317
#endif /* CONFIG_MITIGATION_UNRET_ENTRY */
318318

319-
#if defined(CONFIG_MITIGATION_UNRET_ENTRY) || defined(CONFIG_CPU_SRSO)
319+
#if defined(CONFIG_MITIGATION_UNRET_ENTRY) || defined(CONFIG_MITIGATION_SRSO)
320320

321321
SYM_FUNC_START(entry_untrain_ret)
322322
ALTERNATIVE_2 JMP_RETBLEED_UNTRAIN_RET, \
@@ -325,7 +325,7 @@ SYM_FUNC_START(entry_untrain_ret)
325325
SYM_FUNC_END(entry_untrain_ret)
326326
__EXPORT_THUNK(entry_untrain_ret)
327327

328-
#endif /* CONFIG_MITIGATION_UNRET_ENTRY || CONFIG_CPU_SRSO */
328+
#endif /* CONFIG_MITIGATION_UNRET_ENTRY || CONFIG_MITIGATION_SRSO */
329329

330330
#ifdef CONFIG_MITIGATION_CALL_DEPTH_TRACKING
331331

include/linux/objtool.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
*/
132132
.macro VALIDATE_UNRET_BEGIN
133133
#if defined(CONFIG_NOINSTR_VALIDATION) && \
134-
(defined(CONFIG_MITIGATION_UNRET_ENTRY) || defined(CONFIG_CPU_SRSO))
134+
(defined(CONFIG_MITIGATION_UNRET_ENTRY) || defined(CONFIG_MITIGATION_SRSO))
135135
.Lhere_\@:
136136
.pushsection .discard.validate_unret
137137
.long .Lhere_\@ - .

scripts/Makefile.vmlinux_o

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ objtool-enabled := $(or $(delay-objtool),$(CONFIG_NOINSTR_VALIDATION))
3838
vmlinux-objtool-args-$(delay-objtool) += $(objtool-args-y)
3939
vmlinux-objtool-args-$(CONFIG_GCOV_KERNEL) += --no-unreachable
4040
vmlinux-objtool-args-$(CONFIG_NOINSTR_VALIDATION) += --noinstr \
41-
$(if $(or $(CONFIG_MITIGATION_UNRET_ENTRY),$(CONFIG_CPU_SRSO)), --unret)
41+
$(if $(or $(CONFIG_MITIGATION_UNRET_ENTRY),$(CONFIG_MITIGATION_SRSO)), --unret)
4242

4343
objtool-args = $(vmlinux-objtool-args-y) --link
4444

0 commit comments

Comments
 (0)