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, 8 insertions, 5 deletions
diff --git a/virt/kvm/irq_comm.c b/virt/kvm/irq_comm.c
index be8aba791554..c516d618d389 100644
--- a/virt/kvm/irq_comm.c
+++ b/virt/kvm/irq_comm.c
@@ -48,7 +48,7 @@ static int kvm_set_ioapic_irq(struct kvm_kernel_irq_routing_entry *e,
48static int kvm_set_msi(struct kvm_kernel_irq_routing_entry *e, 48static int kvm_set_msi(struct kvm_kernel_irq_routing_entry *e,
49 struct kvm *kvm, int level) 49 struct kvm *kvm, int level)
50{ 50{
51 int vcpu_id; 51 int vcpu_id, r = -1;
52 struct kvm_vcpu *vcpu; 52 struct kvm_vcpu *vcpu;
53 struct kvm_ioapic *ioapic = ioapic_irqchip(kvm); 53 struct kvm_ioapic *ioapic = ioapic_irqchip(kvm);
54 int dest_id = (e->msi.address_lo & MSI_ADDR_DEST_ID_MASK) 54 int dest_id = (e->msi.address_lo & MSI_ADDR_DEST_ID_MASK)
@@ -73,7 +73,7 @@ static int kvm_set_msi(struct kvm_kernel_irq_routing_entry *e,
73 vcpu = kvm_get_lowest_prio_vcpu(ioapic->kvm, vector, 73 vcpu = kvm_get_lowest_prio_vcpu(ioapic->kvm, vector,
74 deliver_bitmask); 74 deliver_bitmask);
75 if (vcpu != NULL) 75 if (vcpu != NULL)
76 kvm_apic_set_irq(vcpu, vector, trig_mode); 76 r = kvm_apic_set_irq(vcpu, vector, trig_mode);
77 else 77 else
78 printk(KERN_INFO "kvm: null lowest priority vcpu!\n"); 78 printk(KERN_INFO "kvm: null lowest priority vcpu!\n");
79 break; 79 break;
@@ -83,14 +83,17 @@ static int kvm_set_msi(struct kvm_kernel_irq_routing_entry *e,
83 continue; 83 continue;
84 deliver_bitmask &= ~(1 << vcpu_id); 84 deliver_bitmask &= ~(1 << vcpu_id);
85 vcpu = ioapic->kvm->vcpus[vcpu_id]; 85 vcpu = ioapic->kvm->vcpus[vcpu_id];
86 if (vcpu) 86 if (vcpu) {
87 kvm_apic_set_irq(vcpu, vector, trig_mode); 87 if (r < 0)
88 r = 0;
89 r += kvm_apic_set_irq(vcpu, vector, trig_mode);
90 }
88 } 91 }
89 break; 92 break;
90 default: 93 default:
91 break; 94 break;
92 } 95 }
93 return 1; 96 return r;
94} 97}
95 98
96/* This should be called with the kvm->lock mutex held 99/* This should be called with the kvm->lock mutex held