]> git.ipfire.org Git - thirdparty/linux.git/commit
KVM: SVM: Treat mapping failures equally in VMLOAD/VMSAVE emulation
authorYosry Ahmed <yosry@kernel.org>
Mon, 16 Mar 2026 20:27:29 +0000 (20:27 +0000)
committerSean Christopherson <seanjc@google.com>
Fri, 3 Apr 2026 23:08:03 +0000 (16:08 -0700)
commit878b8efa2adbbfffc97f68cbba243cdf18d943c0
tree3d1e15cbd786393053da851718897d9960d2cca6
parent783cf7d01fb8788f37735c0a6c3955024189287c
KVM: SVM: Treat mapping failures equally in VMLOAD/VMSAVE emulation

Currently, a #GP is only injected if kvm_vcpu_map() fails with -EINVAL.
But it could also fail with -EFAULT if creating a host mapping failed.
Inject a #GP in all cases, no reason to treat failure modes differently.

Similar to commit 01ddcdc55e09 ("KVM: nSVM: Always inject a #GP if
mapping VMCB12 fails on nested VMRUN"), treat all failures equally.

Fixes: 8c5fbf1a7231 ("KVM/nSVM: Use the new mapping API for mapping guest memory")
Signed-off-by: Yosry Ahmed <yosry@kernel.org>
Link: https://patch.msgid.link/20260316202732.3164936-7-yosry@kernel.org
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/svm.c