[PATCH 0/2] KVM: nSVM: Minor post-war fixups
From: Yosry Ahmed
Date: Thu Mar 05 2026 - 15:30:49 EST
A couple of fixups in the aftermath of all nSVM patches, the first one
is just a cleanup suggested offlist by Sean, and the second is a fix for
the test to make sure it's checking #GP on VMRUN not VMLOAD.
In all honestly, I am not sure *why* the test was passing and a #GP was
generated on VMLOAD with a very large but valid GPA. vls=1, so KVM
should not be intercepting VMLOAD (in which case it would inject the
#GP). A #NPF is generated on the VMLOAD, and through tracing I found out
that kvm_mmu_page_fault() returns 1 (RETRY) to npf_interception(). There
shouldn't be a corresponding memslot, so I am not sure if KVM stuffed an
invalid mapping in the NPTs, or if KVM did nothing and the CPU #GP due
to an infinite #NPF loop (although npf_interception() was only called
once). Anyway, figuring that out is irrelevant to the fixup, which makes
sure we're actually getting #GP on VMRUN.
Yosry Ahmed (2):
KVM: nSVM: Simplify error handling of
nested_svm_copy_vmcb12_to_cache()
KVM: selftests: Actually check #GP on VMRUN with invalid vmcb12
arch/x86/kvm/svm/nested.c | 23 +++++++-------
.../kvm/x86/svm_nested_invalid_vmcb12_gpa.c | 31 +++++++++----------
2 files changed, 26 insertions(+), 28 deletions(-)
base-commit: 5128b972fb2801ad9aca54d990a75611ab5283a9
--
2.53.0.473.g4a7958ca14-goog