KVM: SVM: set IRR in svm_deliver_interrupt
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 8 Feb 2022 11:57:07 +0000 (06:57 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 11 Feb 2022 17:53:02 +0000 (12:53 -0500)
SVM has to set IRR for both the AVIC and the software-LAPIC case,
so pull it up to the common function that handles both configurations.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/avic.c
arch/x86/kvm/svm/svm.c

index 242cb220893ae72a7c7e3d4d23671a78ff818c22..2b2932f04411fd2f7fe45d2e4824b1a732c8d6c0 100644 (file)
@@ -668,8 +668,6 @@ int svm_deliver_avic_intr(struct kvm_vcpu *vcpu, int vec)
        if (!vcpu->arch.apicv_active)
                return -1;
 
-       kvm_lapic_set_irr(vec, vcpu->arch.apic);
-
        /*
         * Pairs with the smp_mb_*() after setting vcpu->guest_mode in
         * vcpu_enter_guest() to ensure the write to the vIRR is ordered before
index 52e4130110f3f8dc1f839a25126d0956b998678f..cd769ff8af165b0feedadfc21e546413a03094b9 100644 (file)
@@ -3304,8 +3304,8 @@ static void svm_deliver_interrupt(struct kvm_lapic *apic, int delivery_mode,
 {
        struct kvm_vcpu *vcpu = apic->vcpu;
 
+       kvm_lapic_set_irr(vector, apic);
        if (svm_deliver_avic_intr(vcpu, vector)) {
-               kvm_lapic_set_irr(vector, apic);
                kvm_make_request(KVM_REQ_EVENT, vcpu);
                kvm_vcpu_kick(vcpu);
        } else {