Skip to content

KVM: x86: Fix EFER reserved bits initialization

Yosry Ahmed kvm lkml sashiko-reviews stable 1 version Applied

Status from this message: Applied to kvm-x86 misc, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v3 Latest5 patches 2 repliesApplied

Changes in v3 from the cover letter

- Drop KVM_SET_SREGS* validity checks fixes, sent separately.
- Re-ordered and reworked the patches to re-initialize EFER reserved bits right away.
- Drop the per-vendor op for EFER caps initialization, instead move EFER.SVME and EFER.LMSLE handling to generic x86 code.

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/5KVM: x86: Move enabling EFER.SVME and EFER.LMSLE to generic EFER setuparch/x86/kvm/svm/svm.c arch/x86/kvm/x86.c+6 -40 replies
2/5KVM: x86: Disallow EFER.LME and EFER.LMA if long mode is not supportedarch/x86/kvm/msrs.c arch/x86/kvm/x86.c+4 -91 reply
3/5KVM: x86: Always initialize EFER reserved bits on vendor initializationarch/x86/kvm/msrs.c arch/x86/kvm/msrs.h arch/x86/kvm/x86.c+11 -20 replies
4/5KVM: x86: Reverse the polarity of efer_reserved_bitsarch/x86/kvm/msrs.c+5 -50 replies
5/5KVM: x86: Move supported EFER bits to kvm_capsarch/x86/include/asm/kvm_host.h arch/x86/kvm/msrs.c arch/x86/kvm/msrs.h +1 more+12 -260 replies

Reviews trailers per patch

2 of 5 patches have a Reviewed-by or Acked-by.

PatchNikolay Borisov
1/5
2/5
3/5
4/5R-b
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/5] KVM: x86: Fix EFER reserved bits initialization

v3 of fixing EFER reserved bits initialization on vendor module reload, and move them into kvm_caps. I reworked and reordered the patches such that we go straight to reinitializing the EFER reserved bits, instead of first re-reserving the bits on vendor init if nested=0.

The motivation for the previous approach was simpler backports, but practically the fixes don't apply cleanly anyway to most stable kernels due to EFER.LMSLE handling being introduced very recently.

v2 -> v3:
- Drop KVM_SET_SREGS* validity checks fixes, sent separately.
- Re-ordered and reworked the patches to re-initialize EFER reserved bits right away.
- Drop the per-vendor op for EFER caps initialization, instead move EFER.SVME and EFER.LMSLE handling to generic x86 code.

Yosry Ahmed (5):
KVM: x86: Move enabling EFER.SVME and EFER.LMSLE to generic EFER setup
KVM: x86: Disallow EFER.LME and EFER.LMA if long mode is not supported
KVM: x86: Always initialize EFER reserved bits on vendor
initialization
KVM: x86: Reverse the polarity of efer_reserved_bits
KVM: x86: Move supported EFER bits to kvm_caps

 arch/x86/include/asm/kvm_host.h |  2 ++
 arch/x86/kvm/msrs.c             | 21 ++-------------------
 arch/x86/kvm/msrs.h             |  1 -
 arch/x86/kvm/svm/svm.c          |  4 ----
 arch/x86/kvm/x86.c              | 18 +++++++++++++++---
 5 files changed, 19 insertions(+), 27 deletions(-)

base-commit: 3aec122bdcaf6f8c4ecfc7f6adf6773015ced676

Signature · 1 line
2.55.0.141.g00534a21ce-goog