diff options
author | Gleb Natapov <gleb@redhat.com> | 2009-02-23 05:57:11 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-03-24 05:03:11 -0400 |
commit | 71450f78853b82d55cda4e182c9db6e26b631485 (patch) | |
tree | f197d4a944382137eb1cff9f3e4f075491bb8321 /virt | |
parent | c5bc22424021cabda862727fb3f5098b866f074d (diff) |
KVM: Report IRQ injection status for MSI delivered interrupts
Return number of CPUs interrupt was successfully injected into or -1 if
none.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'virt')
-rw-r--r-- | virt/kvm/irq_comm.c | 13 |
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, | |||
48 | static int kvm_set_msi(struct kvm_kernel_irq_routing_entry *e, | 48 | static 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 |