diff options
author | Maxim Levitsky <mlevitsk@redhat.com> | 2022-02-07 17:54:21 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2022-02-08 13:30:48 -0500 |
commit | 759cbd59674a6c0aec616a3f4f0740ebd3f5fbef (patch) | |
tree | 719e161821be7646aa1cf35412b0215dba3c17ab /arch/x86/kvm/svm/svm.c | |
parent | e8efa4ff00374d2e6f47f6e4628ca3b541c001af (diff) | |
download | linux-759cbd59674a6c0aec616a3f4f0740ebd3f5fbef.tar.bz2 |
KVM: x86: nSVM/nVMX: set nested_run_pending on VM entry which is a result of RSM
While RSM induced VM entries are not full VM entries,
they still need to be followed by actual VM entry to complete it,
unlike setting the nested state.
This patch fixes boot of hyperv and SMM enabled
windows VM running nested on KVM, which fail due
to this issue combined with lack of dirty bit setting.
Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Cc: stable@vger.kernel.org
Message-Id: <20220207155447.840194-5-mlevitsk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/svm/svm.c')
-rw-r--r-- | arch/x86/kvm/svm/svm.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c index fabbc73c68e2..2ea7985028fe 100644 --- a/arch/x86/kvm/svm/svm.c +++ b/arch/x86/kvm/svm/svm.c @@ -4263,6 +4263,11 @@ static int svm_leave_smm(struct kvm_vcpu *vcpu, const char *smstate) nested_copy_vmcb_save_to_cache(svm, &vmcb12->save); ret = enter_svm_guest_mode(vcpu, vmcb12_gpa, vmcb12, false); + if (ret) + goto unmap_save; + + svm->nested.nested_run_pending = 1; + unmap_save: kvm_vcpu_unmap(vcpu, &map_save, true); unmap_map: |