提交 79d5a52a 编写于 作者: M Maxim Levitsky 提交者: sanglipeng

KVM: x86: nSVM: leave nested mode on vCPU free

stable inclusion
from stable-v5.10.157
commit 7e5cb13091e62b2ad2fe1d3a48753c7219a3e9f9
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7MU59

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=7e5cb13091e62b2ad2fe1d3a48753c7219a3e9f9

--------------------------------

commit 917401f2 upstream.

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: stable@vger.kernel.org
Signed-off-by: NMaxim Levitsky <mlevitsk@redhat.com>
Message-Id: <20221103141351.50662-2-mlevitsk@redhat.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Nsanglipeng <sanglipeng1@jd.com>
上级 73d4a8a7
...@@ -1359,6 +1359,7 @@ static void svm_free_vcpu(struct kvm_vcpu *vcpu) ...@@ -1359,6 +1359,7 @@ static void svm_free_vcpu(struct kvm_vcpu *vcpu)
*/ */
svm_clear_current_vmcb(svm->vmcb); svm_clear_current_vmcb(svm->vmcb);
svm_leave_nested(vcpu);
svm_free_nested(svm); svm_free_nested(svm);
__free_page(pfn_to_page(__sme_clr(svm->vmcb_pa) >> PAGE_SHIFT)); __free_page(pfn_to_page(__sme_clr(svm->vmcb_pa) >> PAGE_SHIFT));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册