Skip to content

Commit bd9a854

Browse files
yosrym93Ingo Molnar
authored andcommitted
x86/bugs: Remove the X86_FEATURE_USE_IBPB check in ib_prctl_set()
If X86_FEATURE_USE_IBPB is not set, then both spectre_v2_user_ibpb and spectre_v2_user_stibp are set to SPECTRE_V2_USER_NONE in spectre_v2_user_select_mitigation(). Since ib_prctl_set() already checks for this before performing the IBPB, the X86_FEATURE_USE_IBPB check is redundant. Remove it. Signed-off-by: Yosry Ahmed <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Acked-by: Josh Poimboeuf <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent a48dc42 commit bd9a854

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kernel/cpu/bugs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2272,7 +2272,7 @@ static int ib_prctl_set(struct task_struct *task, unsigned long ctrl)
22722272
if (ctrl == PR_SPEC_FORCE_DISABLE)
22732273
task_set_spec_ib_force_disable(task);
22742274
task_update_spec_tif(task);
2275-
if (task == current && cpu_feature_enabled(X86_FEATURE_USE_IBPB))
2275+
if (task == current)
22762276
indirect_branch_prediction_barrier();
22772277
break;
22782278
default:

0 commit comments

Comments
 (0)