Skip to content

Commit 99ee56c

Browse files
jpoimboebp3tk0v
authored andcommitted
x86/calldepth: Rename __x86_return_skl() to call_depth_return_thunk()
For consistency with the other return thunks, rename __x86_return_skl() to call_depth_return_thunk(). Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Acked-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://lore.kernel.org/r/ae44e9f9976934e3b5b47a458d523ccb15867561.1693889988.git.jpoimboe@kernel.org
1 parent e8efc08 commit 99ee56c

3 files changed

Lines changed: 8 additions & 12 deletions

File tree

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

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -358,12 +358,7 @@ extern void entry_ibpb(void);
358358
extern void (*x86_return_thunk)(void);
359359

360360
#ifdef CONFIG_CALL_DEPTH_TRACKING
361-
extern void __x86_return_skl(void);
362-
363-
static inline void x86_set_skl_return_thunk(void)
364-
{
365-
x86_return_thunk = &__x86_return_skl;
366-
}
361+
extern void call_depth_return_thunk(void);
367362

368363
#define CALL_DEPTH_ACCOUNT \
369364
ALTERNATIVE("", \
@@ -376,12 +371,12 @@ DECLARE_PER_CPU(u64, __x86_ret_count);
376371
DECLARE_PER_CPU(u64, __x86_stuffs_count);
377372
DECLARE_PER_CPU(u64, __x86_ctxsw_count);
378373
#endif
379-
#else
380-
static inline void x86_set_skl_return_thunk(void) {}
374+
#else /* !CONFIG_CALL_DEPTH_TRACKING */
381375

376+
static inline void call_depth_return_thunk(void) {}
382377
#define CALL_DEPTH_ACCOUNT ""
383378

384-
#endif
379+
#endif /* CONFIG_CALL_DEPTH_TRACKING */
385380

386381
#ifdef CONFIG_RETPOLINE
387382

arch/x86/kernel/cpu/bugs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1059,7 +1059,8 @@ static void __init retbleed_select_mitigation(void)
10591059
case RETBLEED_MITIGATION_STUFF:
10601060
setup_force_cpu_cap(X86_FEATURE_RETHUNK);
10611061
setup_force_cpu_cap(X86_FEATURE_CALL_DEPTH);
1062-
x86_set_skl_return_thunk();
1062+
1063+
x86_return_thunk = call_depth_return_thunk;
10631064
break;
10641065

10651066
default:

arch/x86/lib/retpoline.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ __EXPORT_THUNK(entry_untrain_ret)
323323
#ifdef CONFIG_CALL_DEPTH_TRACKING
324324

325325
.align 64
326-
SYM_FUNC_START(__x86_return_skl)
326+
SYM_FUNC_START(call_depth_return_thunk)
327327
ANNOTATE_NOENDBR
328328
/*
329329
* Keep the hotpath in a 16byte I-fetch for the non-debug
@@ -350,7 +350,7 @@ SYM_FUNC_START(__x86_return_skl)
350350
ANNOTATE_UNRET_SAFE
351351
ret
352352
int3
353-
SYM_FUNC_END(__x86_return_skl)
353+
SYM_FUNC_END(call_depth_return_thunk)
354354

355355
#endif /* CONFIG_CALL_DEPTH_TRACKING */
356356

0 commit comments

Comments
 (0)