Skip to content

Commit e0b8fcf

Browse files
leitaoingomolnar
authored andcommitted
x86/bugs: Rename CONFIG_CPU_IBPB_ENTRY => CONFIG_MITIGATION_IBPB_ENTRY
Step 2/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-3-leitao@debian.org
1 parent be83e80 commit e0b8fcf

3 files changed

Lines changed: 8 additions & 7 deletions

File tree

arch/x86/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2554,7 +2554,7 @@ config CALL_THUNKS_DEBUG
25542554
Only enable this when you are debugging call thunks as this
25552555
creates a noticeable runtime overhead. If unsure say N.
25562556

2557-
config CPU_IBPB_ENTRY
2557+
config MITIGATION_IBPB_ENTRY
25582558
bool "Enable IBPB on kernel entry"
25592559
depends on CPU_SUP_AMD && X86_64
25602560
default y

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@
289289
* where we have a stack but before any RET instruction.
290290
*/
291291
.macro __UNTRAIN_RET ibpb_feature, call_depth_insns
292-
#if defined(CONFIG_RETHUNK) || defined(CONFIG_CPU_IBPB_ENTRY)
292+
#if defined(CONFIG_RETHUNK) || defined(CONFIG_MITIGATION_IBPB_ENTRY)
293293
VALIDATE_UNRET_END
294294
ALTERNATIVE_3 "", \
295295
CALL_UNTRAIN_RET, X86_FEATURE_UNRET, \

arch/x86/kernel/cpu/bugs.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -994,10 +994,10 @@ static void __init retbleed_select_mitigation(void)
994994
if (!boot_cpu_has(X86_FEATURE_IBPB)) {
995995
pr_err("WARNING: CPU does not support IBPB.\n");
996996
goto do_cmd_auto;
997-
} else if (IS_ENABLED(CONFIG_CPU_IBPB_ENTRY)) {
997+
} else if (IS_ENABLED(CONFIG_MITIGATION_IBPB_ENTRY)) {
998998
retbleed_mitigation = RETBLEED_MITIGATION_IBPB;
999999
} else {
1000-
pr_err("WARNING: kernel not compiled with CPU_IBPB_ENTRY.\n");
1000+
pr_err("WARNING: kernel not compiled with MITIGATION_IBPB_ENTRY.\n");
10011001
goto do_cmd_auto;
10021002
}
10031003
break;
@@ -1023,7 +1023,8 @@ static void __init retbleed_select_mitigation(void)
10231023
boot_cpu_data.x86_vendor == X86_VENDOR_HYGON) {
10241024
if (IS_ENABLED(CONFIG_CPU_UNRET_ENTRY))
10251025
retbleed_mitigation = RETBLEED_MITIGATION_UNRET;
1026-
else if (IS_ENABLED(CONFIG_CPU_IBPB_ENTRY) && boot_cpu_has(X86_FEATURE_IBPB))
1026+
else if (IS_ENABLED(CONFIG_MITIGATION_IBPB_ENTRY) &&
1027+
boot_cpu_has(X86_FEATURE_IBPB))
10271028
retbleed_mitigation = RETBLEED_MITIGATION_IBPB;
10281029
}
10291030

@@ -2482,13 +2483,13 @@ static void __init srso_select_mitigation(void)
24822483
break;
24832484

24842485
case SRSO_CMD_IBPB:
2485-
if (IS_ENABLED(CONFIG_CPU_IBPB_ENTRY)) {
2486+
if (IS_ENABLED(CONFIG_MITIGATION_IBPB_ENTRY)) {
24862487
if (has_microcode) {
24872488
setup_force_cpu_cap(X86_FEATURE_ENTRY_IBPB);
24882489
srso_mitigation = SRSO_MITIGATION_IBPB;
24892490
}
24902491
} else {
2491-
pr_err("WARNING: kernel not compiled with CPU_IBPB_ENTRY.\n");
2492+
pr_err("WARNING: kernel not compiled with MITIGATION_IBPB_ENTRY.\n");
24922493
}
24932494
break;
24942495

0 commit comments

Comments
 (0)