IBPB cleanups and a fixup
Status from this message: The following commit has been merged into the x86/bugs branch of tip:
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest6 patches 2 repliesApplied
- v16 patches 14 repliesSuperseded
Changes in v2 from the cover letter
- Collected Ack/Review tags (thanks everyone!).
- Combined the if statements in vmx_vcpu_load_vmcs() and moved the static branch check ahead (Sean Christopherson).
- Renamed the static branch to switch_vcpu_ibpb (Sean Christopherson).
- Fixed a typo in the commit message (Jim Mattson).
Patches in v2 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | x86/bugs: Move the X86_FEATURE_USE_IBPB check into callersarch/ arch/ arch/ +3 more | +12 | 1 reply | |
| 2/6 | x86/mm: Remove X86_FEATURE_USE_IBPB checks in cond_mitigation()arch/ | +2 | 0 replies | |
| 3/6 | x86/bugs: Remove the X86_FEATURE_USE_IBPB check in ib_prctl_set()arch/ | +1 | 0 replies | |
| 4/6 | x86/bugs: Use a static branch to guard IBPB on vCPU switcharch/ arch/ arch/ +1 more | +9 | 1 reply | |
| 5/6 | KVM: nVMX: Always use IBPB to properly virtualize IBRSarch/ | +1 | 0 replies | |
| 6/6 | x86/bugs: Remove X86_FEATURE_USE_IBPBarch/ arch/ tools/ | +0 | 0 replies |
Reviews trailers per patch
All 6 patches have a Reviewed-by or Acked-by.
| Patch | Josh Poimboeuf | Jim Mattson | Sean Christopherson |
|---|---|---|---|
| 1/6 | A-b | A-b | |
| 2/6 | A-b | ||
| 3/6 | A-b | ||
| 4/6 | A-b | A-b | |
| 5/6 | A-b | R-b | A-b |
| 6/6 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [PATCH v2 0/6] IBPB cleanups and a fixup
This series removes X86_FEATURE_USE_IBPB, and fixes a KVM nVMX bug in the process. The motivation is mostly the confusing name of X86_FEATURE_USE_IBPB, which sounds like it controls IBPBs in general, but it only controls IBPBs for spectre_v2_mitigation. A side effect of this confusion is the nVMX bug, where virtualizing IBRS correctly depends on the spectre_v2_user mitigation.
The feature bit is mostly redundant, except in controlling the IBPB in the vCPU load path. For that, a separate static branch is introduced, similar to switch_mm_*_ibpb.
We should also unify indirect_branch_prediction_barrier() with entry_ibpb() to have a single IBPB primitive that always stuffs the RSB if needed. Josh will be sending follow up changes for that.
v1 -> v2:
- Collected Ack/Review tags (thanks everyone!).
- Combined the if statements in vmx_vcpu_load_vmcs() and moved the static branch check ahead (Sean Christopherson).
- Renamed the static branch to switch_vcpu_ibpb (Sean Christopherson).
- Fixed a typo in the commit message (Jim Mattson).
Yosry Ahmed (6):
x86/bugs: Move the X86_FEATURE_USE_IBPB check into callers x86/mm: Remove X86_FEATURE_USE_IBPB checks in cond_mitigation() x86/bugs: Remove the X86_FEATURE_USE_IBPB check in ib_prctl_set() x86/bugs: Use a static branch to guard IBPB on vCPU switch
KVM: nVMX: Always use IBPB to properly virtualize IBRS x86/bugs: Remove X86_FEATURE_USE_IBPB
arch/x86/include/asm/cpufeatures.h | 1 - arch/x86/include/asm/nospec-branch.h | 4 +++- arch/x86/kernel/cpu/bugs.c | 6 +++++- arch/x86/kvm/svm/svm.c | 3 ++- arch/x86/kvm/vmx/vmx.c | 3 ++- arch/x86/mm/tlb.c | 3 +-- tools/arch/x86/include/asm/cpufeatures.h | 1 - 7 files changed, 13 insertions(+), 8 deletions(-)
Signature · 1 line
2.48.1.658.g4767266eb4-goog