Skip to content

Commit 13235d6

Browse files
jpoimboeIngo Molnar
authored andcommitted
x86/bugs: Rename entry_ibpb() to write_ibpb()
There's nothing entry-specific about entry_ibpb(). In preparation for calling it from elsewhere, rename it to write_ibpb(). Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/1e54ace131e79b760de3fe828264e26d0896e3ac.1744148254.git.jpoimboe@kernel.org
1 parent 9964571 commit 13235d6

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

arch/x86/entry/entry.S

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717

1818
.pushsection .noinstr.text, "ax"
1919

20-
SYM_FUNC_START(entry_ibpb)
20+
/* Clobbers AX, CX, DX */
21+
SYM_FUNC_START(write_ibpb)
2122
ANNOTATE_NOENDBR
2223
movl $MSR_IA32_PRED_CMD, %ecx
2324
movl $PRED_CMD_IBPB, %eax
@@ -27,9 +28,9 @@ SYM_FUNC_START(entry_ibpb)
2728
/* Make sure IBPB clears return stack preductions too. */
2829
FILL_RETURN_BUFFER %rax, RSB_CLEAR_LOOPS, X86_BUG_IBPB_NO_RET
2930
RET
30-
SYM_FUNC_END(entry_ibpb)
31+
SYM_FUNC_END(write_ibpb)
3132
/* For KVM */
32-
EXPORT_SYMBOL_GPL(entry_ibpb);
33+
EXPORT_SYMBOL_GPL(write_ibpb);
3334

3435
.popsection
3536

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@
269269
* typically has NO_MELTDOWN).
270270
*
271271
* While retbleed_untrain_ret() doesn't clobber anything but requires stack,
272-
* entry_ibpb() will clobber AX, CX, DX.
272+
* write_ibpb() will clobber AX, CX, DX.
273273
*
274274
* As such, this must be placed after every *SWITCH_TO_KERNEL_CR3 at a point
275275
* where we have a stack but before any RET instruction.
@@ -279,7 +279,7 @@
279279
VALIDATE_UNRET_END
280280
CALL_UNTRAIN_RET
281281
ALTERNATIVE_2 "", \
282-
"call entry_ibpb", \ibpb_feature, \
282+
"call write_ibpb", \ibpb_feature, \
283283
__stringify(\call_depth_insns), X86_FEATURE_CALL_DEPTH
284284
#endif
285285
.endm
@@ -368,7 +368,7 @@ extern void srso_return_thunk(void);
368368
extern void srso_alias_return_thunk(void);
369369

370370
extern void entry_untrain_ret(void);
371-
extern void entry_ibpb(void);
371+
extern void write_ibpb(void);
372372

373373
#ifdef CONFIG_X86_64
374374
extern void clear_bhb_loop(void);

arch/x86/kernel/cpu/bugs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,7 @@ static void __init retbleed_select_mitigation(void)
11421142
setup_clear_cpu_cap(X86_FEATURE_RETHUNK);
11431143

11441144
/*
1145-
* There is no need for RSB filling: entry_ibpb() ensures
1145+
* There is no need for RSB filling: write_ibpb() ensures
11461146
* all predictions, including the RSB, are invalidated,
11471147
* regardless of IBPB implementation.
11481148
*/
@@ -2676,7 +2676,7 @@ static void __init srso_select_mitigation(void)
26762676
setup_clear_cpu_cap(X86_FEATURE_RETHUNK);
26772677

26782678
/*
2679-
* There is no need for RSB filling: entry_ibpb() ensures
2679+
* There is no need for RSB filling: write_ibpb() ensures
26802680
* all predictions, including the RSB, are invalidated,
26812681
* regardless of IBPB implementation.
26822682
*/
@@ -2701,7 +2701,7 @@ static void __init srso_select_mitigation(void)
27012701
srso_mitigation = SRSO_MITIGATION_IBPB_ON_VMEXIT;
27022702

27032703
/*
2704-
* There is no need for RSB filling: entry_ibpb() ensures
2704+
* There is no need for RSB filling: write_ibpb() ensures
27052705
* all predictions, including the RSB, are invalidated,
27062706
* regardless of IBPB implementation.
27072707
*/

0 commit comments

Comments
 (0)