aboutsummaryrefslogtreecommitdiffstats
path: root/virt/kvm/ioapic.c
diff options
context:
space:
mode:
Diffstat (limited to 'virt/kvm/ioapic.c')
-rw-r--r--virt/kvm/ioapic.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c
index 883fd0dc9b78..3b5371299dd1 100644
--- a/virt/kvm/ioapic.c
+++ b/virt/kvm/ioapic.c
@@ -161,22 +161,22 @@ static void ioapic_inj_nmi(struct kvm_vcpu *vcpu)
161 kvm_vcpu_kick(vcpu); 161 kvm_vcpu_kick(vcpu);
162} 162}
163 163
164u32 kvm_ioapic_get_delivery_bitmask(struct kvm_ioapic *ioapic, u8 dest, 164void kvm_ioapic_get_delivery_bitmask(struct kvm_ioapic *ioapic, u8 dest,
165 u8 dest_mode) 165 u8 dest_mode, unsigned long *mask)
166{ 166{
167 u32 mask = 0;
168 int i; 167 int i;
169 struct kvm *kvm = ioapic->kvm; 168 struct kvm *kvm = ioapic->kvm;
170 struct kvm_vcpu *vcpu; 169 struct kvm_vcpu *vcpu;
171 170
172 ioapic_debug("dest %d dest_mode %d\n", dest, dest_mode); 171 ioapic_debug("dest %d dest_mode %d\n", dest, dest_mode);
173 172
173 *mask = 0;
174 if (dest_mode == 0) { /* Physical mode. */ 174 if (dest_mode == 0) { /* Physical mode. */
175 if (dest == 0xFF) { /* Broadcast. */ 175 if (dest == 0xFF) { /* Broadcast. */
176 for (i = 0; i < KVM_MAX_VCPUS; ++i) 176 for (i = 0; i < KVM_MAX_VCPUS; ++i)
177 if (kvm->vcpus[i] && kvm->vcpus[i]->arch.apic) 177 if (kvm->vcpus[i] && kvm->vcpus[i]->arch.apic)
178 mask |= 1 << i; 178 *mask |= 1 << i;
179 return mask; 179 return;
180 } 180 }
181 for (i = 0; i < KVM_MAX_VCPUS; ++i) { 181 for (i = 0; i < KVM_MAX_VCPUS; ++i) {
182 vcpu = kvm->vcpus[i]; 182 vcpu = kvm->vcpus[i];
@@ -184,7 +184,7 @@ u32 kvm_ioapic_get_delivery_bitmask(struct kvm_ioapic *ioapic, u8 dest,
184 continue; 184 continue;
185 if (kvm_apic_match_physical_addr(vcpu->arch.apic, dest)) { 185 if (kvm_apic_match_physical_addr(vcpu->arch.apic, dest)) {
186 if (vcpu->arch.apic) 186 if (vcpu->arch.apic)
187 mask = 1 << i; 187 *mask = 1 << i;
188 break; 188 break;
189 } 189 }
190 } 190 }
@@ -195,10 +195,9 @@ u32 kvm_ioapic_get_delivery_bitmask(struct kvm_ioapic *ioapic, u8 dest,
195 continue; 195 continue;
196 if (vcpu->arch.apic && 196 if (vcpu->arch.apic &&
197 kvm_apic_match_logical_addr(vcpu->arch.apic, dest)) 197 kvm_apic_match_logical_addr(vcpu->arch.apic, dest))
198 mask |= 1 << vcpu->vcpu_id; 198 *mask |= 1 << vcpu->vcpu_id;
199 } 199 }
200 ioapic_debug("mask %x\n", mask); 200 ioapic_debug("mask %x\n", *mask);
201 return mask;
202} 201}
203 202
204static int ioapic_deliver(struct kvm_ioapic *ioapic, int irq) 203static int ioapic_deliver(struct kvm_ioapic *ioapic, int irq)