]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
x86/bugs: Move the X86_FEATURE_USE_IBPB check into callers
authorYosry Ahmed <yosry.ahmed@linux.dev>
Thu, 27 Feb 2025 01:27:07 +0000 (01:27 +0000)
committerIngo Molnar <mingo@kernel.org>
Thu, 27 Feb 2025 09:57:20 +0000 (10:57 +0100)
commit549435aab49ae83d60a08795de6cf0e866f3b2ec
tree7fd85471fdc9d3db5bde57d47f70160c059601b0
parent8442df2b49ed9bcd67833ad4f091d15ac91efd00
x86/bugs: Move the X86_FEATURE_USE_IBPB check into callers

indirect_branch_prediction_barrier() only performs the MSR write if
X86_FEATURE_USE_IBPB is set, using alternative_msr_write(). In
preparation for removing X86_FEATURE_USE_IBPB, move the feature check
into the callers so that they can be addressed one-by-one, and use
X86_FEATURE_IBPB instead to guard the MSR write.

Signed-off-by: Yosry Ahmed <yosry.ahmed@linux.dev>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Acked-by: Sean Christopherson <seanjc@google.com>
Link: https://lore.kernel.org/r/20250227012712.3193063-2-yosry.ahmed@linux.dev
arch/x86/include/asm/nospec-branch.h
arch/x86/kernel/cpu/bugs.c
arch/x86/kvm/svm/svm.c
arch/x86/kvm/vmx/nested.c
arch/x86/kvm/vmx/vmx.c
arch/x86/mm/tlb.c