aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Levitsky <[email protected]>2022-11-03 16:13:43 +0200
committerPaolo Bonzini <[email protected]>2022-11-17 11:39:53 -0500
commit917401f26a6af5756d89b550a8e1bd50cf42b07e (patch)
tree21bc0f64dd0499a74ba4d595754108d947e19059
parentd72cf8ffe460824fdc97f0a9295a2c4e0231a562 (diff)
KVM: x86: nSVM: leave nested mode on vCPU free
If the VM was terminated while nested, we free the nested state while the vCPU still is in nested mode. Soon a warning will be added for this condition. Cc: [email protected] Signed-off-by: Maxim Levitsky <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
-rw-r--r--arch/x86/kvm/svm/svm.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index 9f88c8e6766e..098f04bec8ef 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -1438,6 +1438,7 @@ static void svm_vcpu_free(struct kvm_vcpu *vcpu)
*/
svm_clear_current_vmcb(svm->vmcb);
+ svm_leave_nested(vcpu);
svm_free_nested(svm);
sev_free_vcpu(vcpu);