Skip to content

Commit ac61d43

Browse files
leitaoIngo Molnar
authored andcommitted
x86/bugs: Rename CONFIG_CPU_UNRET_ENTRY => CONFIG_MITIGATION_UNRET_ENTRY
Step 7/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 7b75782 commit ac61d43

File tree

10 files changed

+18
-18
lines changed

10 files changed

+18
-18
lines changed

arch/x86/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2516,7 +2516,7 @@ config RETHUNK
25162516
Requires a compiler with -mfunction-return=thunk-extern
25172517
support for full protection. The kernel may run slower.
25182518

2519-
config CPU_UNRET_ENTRY
2519+
config MITIGATION_UNRET_ENTRY
25202520
bool "Enable UNRET on kernel entry"
25212521
depends on CPU_SUP_AMD && RETHUNK && X86_64
25222522
default y

arch/x86/include/asm/disabled-features.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
# define DISABLE_RETHUNK (1 << (X86_FEATURE_RETHUNK & 31))
6464
#endif
6565

66-
#ifdef CONFIG_CPU_UNRET_ENTRY
66+
#ifdef CONFIG_MITIGATION_UNRET_ENTRY
6767
# define DISABLE_UNRET 0
6868
#else
6969
# define DISABLE_UNRET (1 << (X86_FEATURE_UNRET & 31))

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_CPU_UNRET_ENTRY) || defined(CONFIG_CPU_SRSO))
215+
(defined(CONFIG_MITIGATION_UNRET_ENTRY) || defined(CONFIG_CPU_SRSO))
216216
ANNOTATE_RETPOLINE_SAFE
217217
nop
218218
#endif
@@ -271,7 +271,7 @@
271271
.Lskip_rsb_\@:
272272
.endm
273273

274-
#if defined(CONFIG_CPU_UNRET_ENTRY) || defined(CONFIG_CPU_SRSO)
274+
#if defined(CONFIG_MITIGATION_UNRET_ENTRY) || defined(CONFIG_CPU_SRSO)
275275
#define CALL_UNTRAIN_RET "call entry_untrain_ret"
276276
#else
277277
#define CALL_UNTRAIN_RET ""
@@ -334,7 +334,7 @@ extern void __x86_return_thunk(void);
334334
static inline void __x86_return_thunk(void) {}
335335
#endif
336336

337-
#ifdef CONFIG_CPU_UNRET_ENTRY
337+
#ifdef CONFIG_MITIGATION_UNRET_ENTRY
338338
extern void retbleed_return_thunk(void);
339339
#else
340340
static inline void retbleed_return_thunk(void) {}

arch/x86/kernel/cpu/amd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ static void fix_erratum_1386(struct cpuinfo_x86 *c)
928928

929929
void init_spectral_chicken(struct cpuinfo_x86 *c)
930930
{
931-
#ifdef CONFIG_CPU_UNRET_ENTRY
931+
#ifdef CONFIG_MITIGATION_UNRET_ENTRY
932932
u64 value;
933933

934934
/*

arch/x86/kernel/cpu/bugs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -982,10 +982,10 @@ static void __init retbleed_select_mitigation(void)
982982
return;
983983

984984
case RETBLEED_CMD_UNRET:
985-
if (IS_ENABLED(CONFIG_CPU_UNRET_ENTRY)) {
985+
if (IS_ENABLED(CONFIG_MITIGATION_UNRET_ENTRY)) {
986986
retbleed_mitigation = RETBLEED_MITIGATION_UNRET;
987987
} else {
988-
pr_err("WARNING: kernel not compiled with CPU_UNRET_ENTRY.\n");
988+
pr_err("WARNING: kernel not compiled with MITIGATION_UNRET_ENTRY.\n");
989989
goto do_cmd_auto;
990990
}
991991
break;
@@ -1021,7 +1021,7 @@ static void __init retbleed_select_mitigation(void)
10211021
case RETBLEED_CMD_AUTO:
10221022
if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD ||
10231023
boot_cpu_data.x86_vendor == X86_VENDOR_HYGON) {
1024-
if (IS_ENABLED(CONFIG_CPU_UNRET_ENTRY))
1024+
if (IS_ENABLED(CONFIG_MITIGATION_UNRET_ENTRY))
10251025
retbleed_mitigation = RETBLEED_MITIGATION_UNRET;
10261026
else if (IS_ENABLED(CONFIG_MITIGATION_IBPB_ENTRY) &&
10271027
boot_cpu_has(X86_FEATURE_IBPB))

arch/x86/kernel/vmlinux.lds.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ INIT_PER_CPU(irq_stack_backing_store);
504504
"fixed_percpu_data is not at start of per-cpu area");
505505
#endif
506506

507-
#ifdef CONFIG_CPU_UNRET_ENTRY
507+
#ifdef CONFIG_MITIGATION_UNRET_ENTRY
508508
. = ASSERT((retbleed_return_thunk & 0x3f) == 0, "retbleed_return_thunk not cacheline-aligned");
509509
#endif
510510

arch/x86/lib/retpoline.S

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ SYM_CODE_END(srso_return_thunk)
230230
#define JMP_SRSO_ALIAS_UNTRAIN_RET "ud2"
231231
#endif /* CONFIG_CPU_SRSO */
232232

233-
#ifdef CONFIG_CPU_UNRET_ENTRY
233+
#ifdef CONFIG_MITIGATION_UNRET_ENTRY
234234

235235
/*
236236
* Some generic notes on the untraining sequences:
@@ -312,11 +312,11 @@ SYM_CODE_END(retbleed_return_thunk)
312312
SYM_FUNC_END(retbleed_untrain_ret)
313313

314314
#define JMP_RETBLEED_UNTRAIN_RET "jmp retbleed_untrain_ret"
315-
#else /* !CONFIG_CPU_UNRET_ENTRY */
315+
#else /* !CONFIG_MITIGATION_UNRET_ENTRY */
316316
#define JMP_RETBLEED_UNTRAIN_RET "ud2"
317-
#endif /* CONFIG_CPU_UNRET_ENTRY */
317+
#endif /* CONFIG_MITIGATION_UNRET_ENTRY */
318318

319-
#if defined(CONFIG_CPU_UNRET_ENTRY) || defined(CONFIG_CPU_SRSO)
319+
#if defined(CONFIG_MITIGATION_UNRET_ENTRY) || defined(CONFIG_CPU_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_CPU_UNRET_ENTRY || CONFIG_CPU_SRSO */
328+
#endif /* CONFIG_MITIGATION_UNRET_ENTRY || CONFIG_CPU_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_CPU_UNRET_ENTRY) || defined(CONFIG_CPU_SRSO))
134+
(defined(CONFIG_MITIGATION_UNRET_ENTRY) || defined(CONFIG_CPU_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_CPU_UNRET_ENTRY),$(CONFIG_CPU_SRSO)), --unret)
41+
$(if $(or $(CONFIG_MITIGATION_UNRET_ENTRY),$(CONFIG_CPU_SRSO)), --unret)
4242

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

tools/arch/x86/include/asm/disabled-features.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
# define DISABLE_RETHUNK (1 << (X86_FEATURE_RETHUNK & 31))
6464
#endif
6565

66-
#ifdef CONFIG_CPU_UNRET_ENTRY
66+
#ifdef CONFIG_MITIGATION_UNRET_ENTRY
6767
# define DISABLE_UNRET 0
6868
#else
6969
# define DISABLE_UNRET (1 << (X86_FEATURE_UNRET & 31))

0 commit comments

Comments
 (0)