The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v2 0/7] KVM: x86: EFER validity fixes and cleanups
@ 2026-07-06 19:54 Yosry Ahmed
  2026-07-06 19:54 ` [PATCH v2 1/7] KVM: x86: Check EFER validity on KVM_SET_SREGS* Yosry Ahmed
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Yosry Ahmed @ 2026-07-06 19:54 UTC (permalink / raw)
  To: Sean Christopherson; +Cc: Paolo Bonzini, kvm, linux-kernel, Yosry Ahmed

A couple of bug fixes for EFER validity checks, namely not doing any on
KVM_SET_SREGS*, and incorrectly preserving EFER.SVME and EFER.LMSLE
state after module unload+load.

The rest of the series reworks EFER supported bits and moves them into
kvm_caps, ensuring they are always reinitialized on vendor module init.
The final patch adds test cases to set_sregs that catch the bug fixed by
patch 1.

v1 -> v2:
- Fix reversing the polarity of efer_reserved_bits to actually reverse
  the bitmask instead of the entire checks [Sashiko]
v1: https://lore.kernel.org/kvm/20260630234716.3039031-1-yosry@kernel.org/

Yosry Ahmed (7):
  KVM: x86: Check EFER validity on KVM_SET_SREGS*
  KVM: SVM: Disallow EFER.SVME and EFER.LSMLE if nested is disabled
  KVM: x86: Disallow EFER.LME and EFER.LMA if long mode is not supported
  KVM: x86: Add a per-vendor callback to setup EFER caps
  KVM: x86: Reverse the polarity of efer_reserved_bits
  KVM: x86: Move supported EFER bits to kvm_caps
  KVM: selftests: Extend set_sregs test to cover EFER

 arch/x86/include/asm/kvm-x86-ops.h            |  1 +
 arch/x86/include/asm/kvm_host.h               |  3 +
 arch/x86/kvm/msrs.c                           | 21 +----
 arch/x86/kvm/msrs.h                           |  1 +
 arch/x86/kvm/regs.c                           |  3 +-
 arch/x86/kvm/svm/svm.c                        | 14 +++-
 arch/x86/kvm/x86.c                            | 18 ++--
 .../selftests/kvm/include/x86/processor.h     |  2 +
 .../selftests/kvm/x86/set_sregs_test.c        | 83 ++++++++++++++-----
 9 files changed, 96 insertions(+), 50 deletions(-)


base-commit: 50406d35f5635e1cc523e61409d57e851b5f5df8
-- 
2.55.0.rc2.803.g1fd1e6609c-goog


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-07-06 19:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-06 19:54 [PATCH v2 0/7] KVM: x86: EFER validity fixes and cleanups Yosry Ahmed
2026-07-06 19:54 ` [PATCH v2 1/7] KVM: x86: Check EFER validity on KVM_SET_SREGS* Yosry Ahmed
2026-07-06 19:54 ` [PATCH v2 2/7] KVM: SVM: Disallow EFER.SVME and EFER.LSMLE if nested is disabled Yosry Ahmed
2026-07-06 19:54 ` [PATCH v2 3/7] KVM: x86: Disallow EFER.LME and EFER.LMA if long mode is not supported Yosry Ahmed
2026-07-06 19:54 ` [PATCH v2 4/7] KVM: x86: Add a per-vendor callback to setup EFER caps Yosry Ahmed
2026-07-06 19:54 ` [PATCH v2 5/7] KVM: x86: Reverse the polarity of efer_reserved_bits Yosry Ahmed
2026-07-06 19:54 ` [PATCH v2 6/7] KVM: x86: Move supported EFER bits to kvm_caps Yosry Ahmed
2026-07-06 19:54 ` [PATCH v2 7/7] KVM: selftests: Extend set_sregs test to cover EFER Yosry Ahmed

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox