aboutsummaryrefslogtreecommitdiffstats
path: root/virt/kvm/irq_comm.c
diff options
context:
space:
mode:
Diffstat (limited to 'virt/kvm/irq_comm.c')
-rw-r--r--virt/kvm/irq_comm.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/virt/kvm/irq_comm.c b/virt/kvm/irq_comm.c
index a797fa5e6420..7aa5086c8622 100644
--- a/virt/kvm/irq_comm.c
+++ b/virt/kvm/irq_comm.c
@@ -59,10 +59,19 @@ void kvm_set_irq(struct kvm *kvm, int irq_source_id, int irq, int level)
59 e->set(e, kvm, !!(*irq_state)); 59 e->set(e, kvm, !!(*irq_state));
60} 60}
61 61
62void kvm_notify_acked_irq(struct kvm *kvm, unsigned gsi) 62void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin)
63{ 63{
64 struct kvm_kernel_irq_routing_entry *e;
64 struct kvm_irq_ack_notifier *kian; 65 struct kvm_irq_ack_notifier *kian;
65 struct hlist_node *n; 66 struct hlist_node *n;
67 unsigned gsi = pin;
68
69 list_for_each_entry(e, &kvm->irq_routing, link)
70 if (e->irqchip.irqchip == irqchip &&
71 e->irqchip.pin == pin) {
72 gsi = e->gsi;
73 break;
74 }
66 75
67 hlist_for_each_entry(kian, n, &kvm->arch.irq_ack_notifier_list, link) 76 hlist_for_each_entry(kian, n, &kvm->arch.irq_ack_notifier_list, link)
68 if (kian->gsi == gsi) 77 if (kian->gsi == gsi)
@@ -237,8 +246,6 @@ out:
237#define ROUTING_ENTRY1(irq) IOAPIC_ROUTING_ENTRY(irq) 246#define ROUTING_ENTRY1(irq) IOAPIC_ROUTING_ENTRY(irq)
238 247
239#ifdef CONFIG_X86 248#ifdef CONFIG_X86
240#define SELECT_PIC(irq) \
241 ((irq) < 8 ? KVM_IRQCHIP_PIC_MASTER : KVM_IRQCHIP_PIC_SLAVE)
242# define PIC_ROUTING_ENTRY(irq) \ 249# define PIC_ROUTING_ENTRY(irq) \
243 { .gsi = irq, .type = KVM_IRQ_ROUTING_IRQCHIP, \ 250 { .gsi = irq, .type = KVM_IRQ_ROUTING_IRQCHIP, \
244 .u.irqchip.irqchip = SELECT_PIC(irq), .u.irqchip.pin = (irq) % 8 } 251 .u.irqchip.irqchip = SELECT_PIC(irq), .u.irqchip.pin = (irq) % 8 }