diff options
| author | Yosry Ahmed <yosry@kernel.org> | 2026-03-03 00:34:02 +0000 |
|---|---|---|
| committer | Sean Christopherson <seanjc@google.com> | 2026-03-04 16:08:48 -0800 |
| commit | 1b30e7551767cb95b3e49bb169c72bbd76b56e05 (patch) | |
| tree | 669618373e8e520fcb8b38d944a371e1ce535b76 /tools/perf/scripts/python/bin | |
| parent | dcf3648ab71437b504abbfdc4e74622a0f1a56e3 (diff) | |
KVM: nSVM: Triple fault if mapping VMCB12 fails on nested #VMEXIT
KVM currently injects a #GP and hopes for the best if mapping VMCB12
fails on nested #VMEXIT, and only if the failure mode is -EINVAL.
Mapping the VMCB12 could also fail if creating host mappings fails.
After the #GP is injected, nested_svm_vmexit() bails early, without
cleaning up (e.g. KVM_REQ_GET_NESTED_STATE_PAGES is set, is_guest_mode()
is true, etc).
Instead of optionally injecting a #GP, triple fault the guest if mapping
VMCB12 fails since KVM cannot make a sane recovery. The APM states that
a #VMEXIT will triple fault if host state is illegal or an exception
occurs while loading host state, so the behavior is not entirely made
up.
Do not return early from nested_svm_vmexit(), continue cleaning up the
vCPU state (e.g. switch back to vmcb01), to handle the failure as
gracefully as possible.
Fixes: cf74a78b229d ("KVM: SVM: Add VMEXIT handler and intercepts")
CC: stable@vger.kernel.org
Co-developed-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Yosry Ahmed <yosry@kernel.org>
Link: https://patch.msgid.link/20260303003421.2185681-9-yosry@kernel.org
Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'tools/perf/scripts/python/bin')
0 files changed, 0 insertions, 0 deletions
