Re: [PATCH v2 0/6] KVM: nSVM: Fix vmcb12 mapping failure handling
From: Sean Christopherson
Date: Fri Apr 03 2026 - 11:20:30 EST
On Fri, 06 Mar 2026 21:08:54 +0000, Yosry Ahmed wrote:
> Jim pointed out that VMRUN/VMLOAD/VMSAVE injecting a #GP when the vmcb12
> GPA is valid but not mappable is not architectural [1]. The series
> handles them as emulation failures and (mostly) exits to userspace
> instead.
>
> With vls=1, a VMSAVE/VMLOAD with an unmappable GPA will cause a #NPF and
> be emulated. The emulator currently hardcodes the GPA check to 48 valid
> bits and injects a #GP otherwise. Fix this to only inject a #GP if the
> GPA actually exceeds maxphyaddr, and otherwise fail the emulation as
> well.
>
> [...]
As promised, applied a tweaked version of patch 2 to kvm-x86 nested, many weeks
ago.
[2/6] KVM: nSVM: Simplify error handling of nested_svm_copy_vmcb12_to_cache()
https://github.com/kvm-x86/linux/commit/520a1347faf4
--
https://github.com/kvm-x86/linux/tree/next