[PATCH v4 0/5] KVM: x86: Honor EFER_LMSLE_MBZ

From: Sean Christopherson

Date: Wed Sep 30 2026 - 18:57:24 EST


Jim's series to try to clean up the EFER.LMSLE_MBZ mess (and what a mess it is).
I (still) didn't touch the KVM patches, and barely touched the selftests, i.e.
Jim's testing from v2 should still hold.

v4:
- Go with a less fancy kvm_is_nested_virtualization_enabled(), because KVM
sucks (and not in an ironic Primus Sucks! way). [Sashiko]

v3:
- https://lore.kernel.org/all/20260930002140.3174449-1-seanjc@xxxxxxxxxx
- Slot in a patch to add kvm_is_nested_virtualization_enabled() instead of
open coding the check and relying on the X86_FEATURE_SVM cheak to make
sure it's kvm_amd.ko under the hood (the patch is constructed so that it
will trigger a noisy conflict with the in-fligh
host_cpu_is_intel_compatible).

v2: https://lore.kernel.org/all/cover.1790208413.git.jmattson@xxxxxxxxxx

v1: https://lore.kernel.org/all/20260918154530.4129698-1-jmattson@xxxxxxxxxx


Jim Mattson (4):
KVM: x86: Advertise EFER_LMSLE_MBZ when KVM disallows EFER.LMSLE
KVM: x86: Honor the guest's EFER_LMSLE_MBZ
KVM: selftests: Rename svm_nested_clear_efer_svme to
svm_nested_efer_test
KVM: selftests: Add coverage for the EFER_LMSLE_MBZ defeature

Sean Christopherson (1):
KVM: selftests: Add module param API to check if nested virtualization
is enabled

Documentation/virt/kvm/api.rst | 25 ++
arch/x86/kvm/cpuid.c | 20 ++
arch/x86/kvm/msrs.c | 12 +-
arch/x86/kvm/svm/svm.c | 21 +-
arch/x86/kvm/vmx/vmx.c | 7 +
arch/x86/kvm/x86.c | 9 +-
tools/testing/selftests/kvm/Makefile.kvm | 2 +-
.../selftests/kvm/include/x86/processor.h | 14 +
.../kvm/x86/svm_nested_clear_efer_svme.c | 50 ----
.../selftests/kvm/x86/svm_nested_efer_test.c | 266 ++++++++++++++++++
10 files changed, 372 insertions(+), 54 deletions(-)
delete mode 100644 tools/testing/selftests/kvm/x86/svm_nested_clear_efer_svme.c
create mode 100644 tools/testing/selftests/kvm/x86/svm_nested_efer_test.c


base-commit: d4b7fb647204f0c81dfeae2d1a708e4d858e0c94
--
2.56.0.rc1.315.gc6ed9934b7-goog