@@ -108,7 +108,7 @@ int kvm_cpu_get_interrupt(struct kvm_vcpu *v)
vector = kvm_cpu_get_extint(v);
- if (kvm_apic_vid_enabled(v->kvm) || vector != -1)
+ if (vector != -1)
return vector; /* PIC */
return kvm_get_apic_interrupt(v); /* APIC */
@@ -1627,10 +1627,13 @@ int kvm_get_apic_interrupt(struct kvm_vcpu *vcpu)
int vector = kvm_apic_has_interrupt(vcpu);
struct kvm_lapic *apic = vcpu->arch.apic;
- /* Note that we never get here with APIC virtualization enabled. */
+ /*
+ * With APIC virtualization enabled, just pass back the
+ * vector, the processor will take care of delivery.
+ */
- if (vector == -1)
- return -1;
+ if (vector == -1 || kvm_apic_vid_enabled(vcpu->kvm))
+ return vector;
apic_set_isr(vector, apic);
apic_update_ppr(apic);