Skip to content

Commit a48dc42

Browse files
yosrym93Ingo Molnar
authored andcommitted
x86/mm: Remove X86_FEATURE_USE_IBPB checks in cond_mitigation()
The check is performed when either switch_mm_cond_ibpb or switch_mm_always_ibpb is set. In both cases, X86_FEATURE_USE_IBPB is always set. Remove the redundant check. 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 549435a commit a48dc42

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

arch/x86/mm/tlb.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -437,8 +437,7 @@ static void cond_mitigation(struct task_struct *next)
437437
* both have the IBPB bit set.
438438
*/
439439
if (next_mm != prev_mm &&
440-
(next_mm | prev_mm) & LAST_USER_MM_IBPB &&
441-
cpu_feature_enabled(X86_FEATURE_USE_IBPB))
440+
(next_mm | prev_mm) & LAST_USER_MM_IBPB)
442441
indirect_branch_prediction_barrier();
443442
}
444443

@@ -448,8 +447,7 @@ static void cond_mitigation(struct task_struct *next)
448447
* different context than the user space task which ran
449448
* last on this CPU.
450449
*/
451-
if ((prev_mm & ~LAST_USER_MM_SPEC_MASK) != (unsigned long)next->mm &&
452-
cpu_feature_enabled(X86_FEATURE_USE_IBPB))
450+
if ((prev_mm & ~LAST_USER_MM_SPEC_MASK) != (unsigned long)next->mm)
453451
indirect_branch_prediction_barrier();
454452
}
455453

0 commit comments

Comments
 (0)