Skip to content

Commit 5fa31af

Browse files
leitaoingomolnar
authored andcommitted
x86/bugs: Rename CONFIG_CALL_DEPTH_TRACKING => CONFIG_MITIGATION_CALL_DEPTH_TRACKING
Step 3/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-4-leitao@debian.org
1 parent e0b8fcf commit 5fa31af

9 files changed

Lines changed: 18 additions & 18 deletions

File tree

arch/x86/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2523,7 +2523,7 @@ config CPU_UNRET_ENTRY
25232523
help
25242524
Compile the kernel with support for the retbleed=unret mitigation.
25252525

2526-
config CALL_DEPTH_TRACKING
2526+
config MITIGATION_CALL_DEPTH_TRACKING
25272527
bool "Mitigate RSB underflow with call depth tracking"
25282528
depends on CPU_SUP_INTEL && HAVE_CALL_THUNKS
25292529
select HAVE_DYNAMIC_FTRACE_NO_PATCHABLE
@@ -2543,7 +2543,7 @@ config CALL_DEPTH_TRACKING
25432543

25442544
config CALL_THUNKS_DEBUG
25452545
bool "Enable call thunks and call depth tracking debugging"
2546-
depends on CALL_DEPTH_TRACKING
2546+
depends on MITIGATION_CALL_DEPTH_TRACKING
25472547
select FUNCTION_ALIGNMENT_32B
25482548
default n
25492549
help

arch/x86/include/asm/current.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ struct pcpu_hot {
1717
struct task_struct *current_task;
1818
int preempt_count;
1919
int cpu_number;
20-
#ifdef CONFIG_CALL_DEPTH_TRACKING
20+
#ifdef CONFIG_MITIGATION_CALL_DEPTH_TRACKING
2121
u64 call_depth;
2222
#endif
2323
unsigned long top_of_stack;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
# define DISABLE_UNRET (1 << (X86_FEATURE_UNRET & 31))
7070
#endif
7171

72-
#ifdef CONFIG_CALL_DEPTH_TRACKING
72+
#ifdef CONFIG_MITIGATION_CALL_DEPTH_TRACKING
7373
# define DISABLE_CALL_DEPTH_TRACKING 0
7474
#else
7575
# define DISABLE_CALL_DEPTH_TRACKING (1 << (X86_FEATURE_CALL_DEPTH & 31))

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
# define CALL_THUNKS_DEBUG_INC_CTXSW
7474
#endif
7575

76-
#if defined(CONFIG_CALL_DEPTH_TRACKING) && !defined(COMPILE_OFFSETS)
76+
#if defined(CONFIG_MITIGATION_CALL_DEPTH_TRACKING) && !defined(COMPILE_OFFSETS)
7777

7878
#include <asm/asm-offsets.h>
7979

@@ -309,7 +309,7 @@
309309

310310

311311
.macro CALL_DEPTH_ACCOUNT
312-
#ifdef CONFIG_CALL_DEPTH_TRACKING
312+
#ifdef CONFIG_MITIGATION_CALL_DEPTH_TRACKING
313313
ALTERNATIVE "", \
314314
__stringify(ASM_INCREMENT_CALL_DEPTH), X86_FEATURE_CALL_DEPTH
315315
#endif
@@ -357,7 +357,7 @@ extern void entry_ibpb(void);
357357

358358
extern void (*x86_return_thunk)(void);
359359

360-
#ifdef CONFIG_CALL_DEPTH_TRACKING
360+
#ifdef CONFIG_MITIGATION_CALL_DEPTH_TRACKING
361361
extern void call_depth_return_thunk(void);
362362

363363
#define CALL_DEPTH_ACCOUNT \
@@ -371,12 +371,12 @@ DECLARE_PER_CPU(u64, __x86_ret_count);
371371
DECLARE_PER_CPU(u64, __x86_stuffs_count);
372372
DECLARE_PER_CPU(u64, __x86_ctxsw_count);
373373
#endif
374-
#else /* !CONFIG_CALL_DEPTH_TRACKING */
374+
#else /* !CONFIG_MITIGATION_CALL_DEPTH_TRACKING */
375375

376376
static inline void call_depth_return_thunk(void) {}
377377
#define CALL_DEPTH_ACCOUNT ""
378378

379-
#endif /* CONFIG_CALL_DEPTH_TRACKING */
379+
#endif /* CONFIG_MITIGATION_CALL_DEPTH_TRACKING */
380380

381381
#ifdef CONFIG_RETPOLINE
382382

arch/x86/kernel/asm-offsets.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ static void __used common(void)
109109
OFFSET(TSS_sp2, tss_struct, x86_tss.sp2);
110110
OFFSET(X86_top_of_stack, pcpu_hot, top_of_stack);
111111
OFFSET(X86_current_task, pcpu_hot, current_task);
112-
#ifdef CONFIG_CALL_DEPTH_TRACKING
112+
#ifdef CONFIG_MITIGATION_CALL_DEPTH_TRACKING
113113
OFFSET(X86_call_depth, pcpu_hot, call_depth);
114114
#endif
115115
#if IS_ENABLED(CONFIG_CRYPTO_ARIA_AESNI_AVX_X86_64)

arch/x86/kernel/cpu/bugs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,15 +1003,15 @@ static void __init retbleed_select_mitigation(void)
10031003
break;
10041004

10051005
case RETBLEED_CMD_STUFF:
1006-
if (IS_ENABLED(CONFIG_CALL_DEPTH_TRACKING) &&
1006+
if (IS_ENABLED(CONFIG_MITIGATION_CALL_DEPTH_TRACKING) &&
10071007
spectre_v2_enabled == SPECTRE_V2_RETPOLINE) {
10081008
retbleed_mitigation = RETBLEED_MITIGATION_STUFF;
10091009

10101010
} else {
1011-
if (IS_ENABLED(CONFIG_CALL_DEPTH_TRACKING))
1011+
if (IS_ENABLED(CONFIG_MITIGATION_CALL_DEPTH_TRACKING))
10121012
pr_err("WARNING: retbleed=stuff depends on spectre_v2=retpoline\n");
10131013
else
1014-
pr_err("WARNING: kernel not compiled with CALL_DEPTH_TRACKING.\n");
1014+
pr_err("WARNING: kernel not compiled with MITIGATION_CALL_DEPTH_TRACKING.\n");
10151015

10161016
goto do_cmd_auto;
10171017
}

arch/x86/lib/retpoline.S

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ SYM_CODE_END(__x86_indirect_thunk_array)
7171
#include <asm/GEN-for-each-reg.h>
7272
#undef GEN
7373

74-
#ifdef CONFIG_CALL_DEPTH_TRACKING
74+
#ifdef CONFIG_MITIGATION_CALL_DEPTH_TRACKING
7575
.macro CALL_THUNK reg
7676
.align RETPOLINE_THUNK_SIZE
7777

@@ -327,7 +327,7 @@ __EXPORT_THUNK(entry_untrain_ret)
327327

328328
#endif /* CONFIG_CPU_UNRET_ENTRY || CONFIG_CPU_SRSO */
329329

330-
#ifdef CONFIG_CALL_DEPTH_TRACKING
330+
#ifdef CONFIG_MITIGATION_CALL_DEPTH_TRACKING
331331

332332
.align 64
333333
SYM_FUNC_START(call_depth_return_thunk)
@@ -359,7 +359,7 @@ SYM_FUNC_START(call_depth_return_thunk)
359359
int3
360360
SYM_FUNC_END(call_depth_return_thunk)
361361

362-
#endif /* CONFIG_CALL_DEPTH_TRACKING */
362+
#endif /* CONFIG_MITIGATION_CALL_DEPTH_TRACKING */
363363

364364
/*
365365
* This function name is magical and is used by -mfunction-return=thunk-extern

scripts/Makefile.lib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ objtool := $(objtree)/tools/objtool/objtool
254254

255255
objtool-args-$(CONFIG_HAVE_JUMP_LABEL_HACK) += --hacks=jump_label
256256
objtool-args-$(CONFIG_HAVE_NOINSTR_HACK) += --hacks=noinstr
257-
objtool-args-$(CONFIG_CALL_DEPTH_TRACKING) += --hacks=skylake
257+
objtool-args-$(CONFIG_MITIGATION_CALL_DEPTH_TRACKING) += --hacks=skylake
258258
objtool-args-$(CONFIG_X86_KERNEL_IBT) += --ibt
259259
objtool-args-$(CONFIG_FINEIBT) += --cfi
260260
objtool-args-$(CONFIG_FTRACE_MCOUNT_USE_OBJTOOL) += --mcount

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
# define DISABLE_UNRET (1 << (X86_FEATURE_UNRET & 31))
7070
#endif
7171

72-
#ifdef CONFIG_CALL_DEPTH_TRACKING
72+
#ifdef CONFIG_MITIGATION_CALL_DEPTH_TRACKING
7373
# define DISABLE_CALL_DEPTH_TRACKING 0
7474
#else
7575
# define DISABLE_CALL_DEPTH_TRACKING (1 << (X86_FEATURE_CALL_DEPTH & 31))

0 commit comments

Comments
 (0)