aboutsummaryrefslogtreecommitdiffstats
path: root/virt/kvm/irq_comm.c
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2010-02-24 14:31:04 -0500
committerStefan Richter <stefanr@s5r6.in-berlin.de>2010-02-24 14:33:45 -0500
commit109d28152b6e9d5de64cd23e3bc08885ccb3d1ef (patch)
treeb7b8863faa05254781acfb85cc41da3eef467c6b /virt/kvm/irq_comm.c
parent168cf9af699e87d5a6f44b684583714ecabb8e71 (diff)
parent60b341b778cc2929df16c0a504c91621b3c6a4ad (diff)
Merge tag 'v2.6.33' for its firewire changes since last branch point
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'virt/kvm/irq_comm.c')
-rw-r--r--virt/kvm/irq_comm.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/virt/kvm/irq_comm.c b/virt/kvm/irq_comm.c
index 9b077342ab54..9fd5b3ebc517 100644
--- a/virt/kvm/irq_comm.c
+++ b/virt/kvm/irq_comm.c
@@ -302,6 +302,7 @@ static int setup_routing_entry(struct kvm_irq_routing_table *rt,
302{ 302{
303 int r = -EINVAL; 303 int r = -EINVAL;
304 int delta; 304 int delta;
305 unsigned max_pin;
305 struct kvm_kernel_irq_routing_entry *ei; 306 struct kvm_kernel_irq_routing_entry *ei;
306 struct hlist_node *n; 307 struct hlist_node *n;
307 308
@@ -322,12 +323,15 @@ static int setup_routing_entry(struct kvm_irq_routing_table *rt,
322 switch (ue->u.irqchip.irqchip) { 323 switch (ue->u.irqchip.irqchip) {
323 case KVM_IRQCHIP_PIC_MASTER: 324 case KVM_IRQCHIP_PIC_MASTER:
324 e->set = kvm_set_pic_irq; 325 e->set = kvm_set_pic_irq;
326 max_pin = 16;
325 break; 327 break;
326 case KVM_IRQCHIP_PIC_SLAVE: 328 case KVM_IRQCHIP_PIC_SLAVE:
327 e->set = kvm_set_pic_irq; 329 e->set = kvm_set_pic_irq;
330 max_pin = 16;
328 delta = 8; 331 delta = 8;
329 break; 332 break;
330 case KVM_IRQCHIP_IOAPIC: 333 case KVM_IRQCHIP_IOAPIC:
334 max_pin = KVM_IOAPIC_NUM_PINS;
331 e->set = kvm_set_ioapic_irq; 335 e->set = kvm_set_ioapic_irq;
332 break; 336 break;
333 default: 337 default:
@@ -335,7 +339,7 @@ static int setup_routing_entry(struct kvm_irq_routing_table *rt,
335 } 339 }
336 e->irqchip.irqchip = ue->u.irqchip.irqchip; 340 e->irqchip.irqchip = ue->u.irqchip.irqchip;
337 e->irqchip.pin = ue->u.irqchip.pin + delta; 341 e->irqchip.pin = ue->u.irqchip.pin + delta;
338 if (e->irqchip.pin >= KVM_IOAPIC_NUM_PINS) 342 if (e->irqchip.pin >= max_pin)
339 goto out; 343 goto out;
340 rt->chip[ue->u.irqchip.irqchip][e->irqchip.pin] = ue->gsi; 344 rt->chip[ue->u.irqchip.irqchip][e->irqchip.pin] = ue->gsi;
341 break; 345 break;