]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
x86: KVM: SVM: refresh AVIC inhibition in svm_leave_nested()
authorMaxim Levitsky <mlevitsk@redhat.com>
Thu, 28 Sep 2023 17:33:53 +0000 (20:33 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 12 Oct 2023 15:09:00 +0000 (11:09 -0400)
svm_leave_nested() similar to a nested VM exit, get the vCPU out of nested
mode and thus should end the local inhibition of AVIC on this vCPU.

Failure to do so, can lead to hangs on guest reboot.

Raise the KVM_REQ_APICV_UPDATE request to refresh the AVIC state of the
current vCPU in this case.

Fixes: f44509f849fe ("KVM: x86: SVM: allow AVIC to co-exist with a nested guest running")
Cc: stable@vger.kernel.org
Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Reviewed-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20230928173354.217464-4-mlevitsk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/nested.c

index dd496c9e5f91f28519ebc27ff6135dbd00ebeada..3fea8c47679e6899742c6f5aa08046da041439a2 100644 (file)
@@ -1253,6 +1253,9 @@ void svm_leave_nested(struct kvm_vcpu *vcpu)
 
                nested_svm_uninit_mmu_context(vcpu);
                vmcb_mark_all_dirty(svm->vmcb);
+
+               if (kvm_apicv_activated(vcpu->kvm))
+                       kvm_make_request(KVM_REQ_APICV_UPDATE, vcpu);
        }
 
        kvm_clear_request(KVM_REQ_GET_NESTED_STATE_PAGES, vcpu);