diff options
| author | Yosry Ahmed <yosry.ahmed@linux.dev> | 2025-02-27 01:27:09 +0000 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2025-02-27 10:57:20 +0100 |
| commit | bd9a8542ceccce1b1d5d5fd5e47be57fe42f9bb9 (patch) | |
| tree | 32abe3092c065e180b67c73ae43b3a0193365527 /arch/x86/kernel/cpu/bugs.c | |
| parent | x86/mm: Remove X86_FEATURE_USE_IBPB checks in cond_mitigation() (diff) | |
| download | linux-bd9a8542ceccce1b1d5d5fd5e47be57fe42f9bb9.tar.gz linux-bd9a8542ceccce1b1d5d5fd5e47be57fe42f9bb9.zip | |
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 <yosry.ahmed@linux.dev>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Link: https://lore.kernel.org/r/20250227012712.3193063-4-yosry.ahmed@linux.dev
Diffstat (limited to 'arch/x86/kernel/cpu/bugs.c')
| -rw-r--r-- | arch/x86/kernel/cpu/bugs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index 754150fc0578..1d7afc40f227 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -2272,7 +2272,7 @@ static int ib_prctl_set(struct task_struct *task, unsigned long ctrl) if (ctrl == PR_SPEC_FORCE_DISABLE) task_set_spec_ib_force_disable(task); task_update_spec_tif(task); - if (task == current && cpu_feature_enabled(X86_FEATURE_USE_IBPB)) + if (task == current) indirect_branch_prediction_barrier(); break; default: |
