aboutsummaryrefslogtreecommitdiffstats
path: root/virt/kvm/irq_comm.c
diff options
context:
space:
mode:
authorYang Zhang <yang.z.zhang@Intel.com>2013-04-11 07:21:37 -0400
committerMarcelo Tosatti <mtosatti@redhat.com>2013-04-15 22:20:34 -0400
commitb4f2225c07dd4d8eef7aa7f5b36a3b72c3cbbe5b (patch)
tree47cecd1a3cec51c6dee70e8558aa749b744ca0e9 /virt/kvm/irq_comm.c
parent8dc6aade5bdc9d436d4ab8328cb15f0adbbc47bf (diff)
KVM: Return destination vcpu on interrupt injection
Add a new parameter to know vcpus who received the interrupt. Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com> Reviewed-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'virt/kvm/irq_comm.c')
-rw-r--r--virt/kvm/irq_comm.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/virt/kvm/irq_comm.c b/virt/kvm/irq_comm.c
index e9073cf4d040..2f07d2e59a2d 100644
--- a/virt/kvm/irq_comm.c
+++ b/virt/kvm/irq_comm.c
@@ -63,7 +63,7 @@ inline static bool kvm_is_dm_lowest_prio(struct kvm_lapic_irq *irq)
63} 63}
64 64
65int kvm_irq_delivery_to_apic(struct kvm *kvm, struct kvm_lapic *src, 65int kvm_irq_delivery_to_apic(struct kvm *kvm, struct kvm_lapic *src,
66 struct kvm_lapic_irq *irq) 66 struct kvm_lapic_irq *irq, unsigned long *dest_map)
67{ 67{
68 int i, r = -1; 68 int i, r = -1;
69 struct kvm_vcpu *vcpu, *lowest = NULL; 69 struct kvm_vcpu *vcpu, *lowest = NULL;
@@ -74,7 +74,7 @@ int kvm_irq_delivery_to_apic(struct kvm *kvm, struct kvm_lapic *src,
74 irq->delivery_mode = APIC_DM_FIXED; 74 irq->delivery_mode = APIC_DM_FIXED;
75 } 75 }
76 76
77 if (kvm_irq_delivery_to_apic_fast(kvm, src, irq, &r)) 77 if (kvm_irq_delivery_to_apic_fast(kvm, src, irq, &r, dest_map))
78 return r; 78 return r;
79 79
80 kvm_for_each_vcpu(i, vcpu, kvm) { 80 kvm_for_each_vcpu(i, vcpu, kvm) {
@@ -88,7 +88,7 @@ int kvm_irq_delivery_to_apic(struct kvm *kvm, struct kvm_lapic *src,
88 if (!kvm_is_dm_lowest_prio(irq)) { 88 if (!kvm_is_dm_lowest_prio(irq)) {
89 if (r < 0) 89 if (r < 0)
90 r = 0; 90 r = 0;
91 r += kvm_apic_set_irq(vcpu, irq); 91 r += kvm_apic_set_irq(vcpu, irq, dest_map);
92 } else if (kvm_lapic_enabled(vcpu)) { 92 } else if (kvm_lapic_enabled(vcpu)) {
93 if (!lowest) 93 if (!lowest)
94 lowest = vcpu; 94 lowest = vcpu;
@@ -98,7 +98,7 @@ int kvm_irq_delivery_to_apic(struct kvm *kvm, struct kvm_lapic *src,
98 } 98 }
99 99
100 if (lowest) 100 if (lowest)
101 r = kvm_apic_set_irq(lowest, irq); 101 r = kvm_apic_set_irq(lowest, irq, dest_map);
102 102
103 return r; 103 return r;
104} 104}
@@ -130,7 +130,7 @@ int kvm_set_msi(struct kvm_kernel_irq_routing_entry *e,
130 130
131 kvm_set_msi_irq(e, &irq); 131 kvm_set_msi_irq(e, &irq);
132 132
133 return kvm_irq_delivery_to_apic(kvm, NULL, &irq); 133 return kvm_irq_delivery_to_apic(kvm, NULL, &irq, NULL);
134} 134}
135 135
136 136
@@ -142,7 +142,7 @@ static int kvm_set_msi_inatomic(struct kvm_kernel_irq_routing_entry *e,
142 142
143 kvm_set_msi_irq(e, &irq); 143 kvm_set_msi_irq(e, &irq);
144 144
145 if (kvm_irq_delivery_to_apic_fast(kvm, NULL, &irq, &r)) 145 if (kvm_irq_delivery_to_apic_fast(kvm, NULL, &irq, &r, NULL))
146 return r; 146 return r;
147 else 147 else
148 return -EWOULDBLOCK; 148 return -EWOULDBLOCK;