x86/bugs: Remove X86_FEATURE_USE_IBPB
authorYosry Ahmed <yosry.ahmed@linux.dev>
Thu, 27 Feb 2025 01:27:12 +0000 (01:27 +0000)
committerIngo Molnar <mingo@kernel.org>
Thu, 27 Feb 2025 09:57:21 +0000 (10:57 +0100)
commit8f64eee70cdd3bb8c3ec7d30f0d1f52922aaef7c
tree137e4e83688128f701e941675145ef0e63617e3e
parent8c4f28cd81fe86033918eec69d5280b532c05842
x86/bugs: Remove X86_FEATURE_USE_IBPB

X86_FEATURE_USE_IBPB was introduced in:

  2961298efe1e ("x86/cpufeatures: Clean up Spectre v2 related CPUID flags")

to have separate flags for when the CPU supports IBPB (i.e. X86_FEATURE_IBPB)
and when an IBPB is actually used to mitigate Spectre v2.

Ever since then, the uses of IBPB expanded. The name became confusing
because it does not control all IBPB executions in the kernel.
Furthermore, because its name is generic and it's buried within
indirect_branch_prediction_barrier(), it's easy to use it not knowing
that it is specific to Spectre v2.

X86_FEATURE_USE_IBPB is no longer needed because all the IBPB executions
it used to control are now controlled through other means (e.g.
switch_mm_*_ibpb static branches).

Remove the unused feature bit.

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-7-yosry.ahmed@linux.dev
arch/x86/include/asm/cpufeatures.h
arch/x86/kernel/cpu/bugs.c
tools/arch/x86/include/asm/cpufeatures.h