KVM: x86: fix lapic_timer_int_injected with APIC-v
authorMarcelo Tosatti <mtosatti@redhat.com>
Mon, 2 Feb 2015 17:26:08 +0000 (15:26 -0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 2 Feb 2015 17:36:25 +0000 (18:36 +0100)
With APICv, LAPIC timer interrupt is always delivered via IRR:
apic_find_highest_irr syncs PIR to IRR.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/lapic.c

index 555956c3c473e10350776b9cc2015270d561a5f6..3481e9eee8f43419b4a42381479c71a7efb06166 100644 (file)
@@ -1086,13 +1086,13 @@ static bool lapic_timer_int_injected(struct kvm_vcpu *vcpu)
 
        if (kvm_apic_hw_enabled(apic)) {
                int vec = reg & APIC_VECTOR_MASK;
+               void *bitmap = apic->regs + APIC_ISR;
 
-               if (kvm_x86_ops->test_posted_interrupt)
-                       return kvm_x86_ops->test_posted_interrupt(vcpu, vec);
-               else {
-                       if (apic_test_vector(vec, apic->regs + APIC_ISR))
-                               return true;
-               }
+               if (kvm_x86_ops->deliver_posted_interrupt)
+                       bitmap = apic->regs + APIC_IRR;
+
+               if (apic_test_vector(vec, bitmap))
+                       return true;
        }
        return false;
 }