/* * Read pending interrupt vector and intack. */ int kvm_cpu_get_interrupt(struct kvm_vcpu *v) { int vector; if (!lapic_in_kernel(v)) return v->arch.interrupt.nr; vector = kvm_cpu_get_extint(v); if (vector != -1) return vector; /* PIC */ return kvm_get_apic_interrupt(v); /* APIC */ }
/* * Read pending interrupt vector and intack. */ int kvm_cpu_get_interrupt(struct kvm_vcpu *v) { int vector; if (!irqchip_in_kernel(v->kvm)) return v->arch.interrupt.nr; vector = kvm_cpu_get_extint(v); if (kvm_apic_vid_enabled(v->kvm) || vector != -1) return vector; /* PIC */ return kvm_get_apic_interrupt(v); /* APIC */ }
/* * Read pending interrupt vector and intack. */ int kvm_cpu_get_interrupt(struct kvm_vcpu *v) { struct kvm_pic *s; int vector; vector = kvm_get_apic_interrupt(v); /* APIC */ if (vector == -1) { if (kvm_apic_accept_pic_intr(v)) { s = pic_irqchip(v->kvm); s->output = 0; /* PIC */ vector = kvm_pic_read_irq(s); } } return vector; }