Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 146475
b: refs/heads/master
c: e5871be
h: refs/heads/master
i:
  146473: bb50fdf
  146471: 9527502
v: v3
  • Loading branch information
Sheng Yang authored and Avi Kivity committed Jun 10, 2009
1 parent 75fbfed commit 48f8afc
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 116191b69b608d0f1513e3abe71d6a46800f2bd6
refs/heads/master: e5871be0f5d6847bc9585c997acb1b917c168f03
17 changes: 8 additions & 9 deletions trunk/virt/kvm/ioapic.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,30 +161,30 @@ static void ioapic_inj_nmi(struct kvm_vcpu *vcpu)
kvm_vcpu_kick(vcpu);
}

u32 kvm_ioapic_get_delivery_bitmask(struct kvm_ioapic *ioapic, u8 dest,
u8 dest_mode)
void kvm_ioapic_get_delivery_bitmask(struct kvm_ioapic *ioapic, u8 dest,
u8 dest_mode, unsigned long *mask)
{
u32 mask = 0;
int i;
struct kvm *kvm = ioapic->kvm;
struct kvm_vcpu *vcpu;

ioapic_debug("dest %d dest_mode %d\n", dest, dest_mode);

*mask = 0;
if (dest_mode == 0) { /* Physical mode. */
if (dest == 0xFF) { /* Broadcast. */
for (i = 0; i < KVM_MAX_VCPUS; ++i)
if (kvm->vcpus[i] && kvm->vcpus[i]->arch.apic)
mask |= 1 << i;
return mask;
*mask |= 1 << i;
return;
}
for (i = 0; i < KVM_MAX_VCPUS; ++i) {
vcpu = kvm->vcpus[i];
if (!vcpu)
continue;
if (kvm_apic_match_physical_addr(vcpu->arch.apic, dest)) {
if (vcpu->arch.apic)
mask = 1 << i;
*mask = 1 << i;
break;
}
}
Expand All @@ -195,10 +195,9 @@ u32 kvm_ioapic_get_delivery_bitmask(struct kvm_ioapic *ioapic, u8 dest,
continue;
if (vcpu->arch.apic &&
kvm_apic_match_logical_addr(vcpu->arch.apic, dest))
mask |= 1 << vcpu->vcpu_id;
*mask |= 1 << vcpu->vcpu_id;
}
ioapic_debug("mask %x\n", mask);
return mask;
ioapic_debug("mask %x\n", *mask);
}

static int ioapic_deliver(struct kvm_ioapic *ioapic, int irq)
Expand Down
4 changes: 2 additions & 2 deletions trunk/virt/kvm/ioapic.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void kvm_ioapic_update_eoi(struct kvm *kvm, int vector, int trigger_mode);
int kvm_ioapic_init(struct kvm *kvm);
int kvm_ioapic_set_irq(struct kvm_ioapic *ioapic, int irq, int level);
void kvm_ioapic_reset(struct kvm_ioapic *ioapic);
u32 kvm_ioapic_get_delivery_bitmask(struct kvm_ioapic *ioapic, u8 dest,
u8 dest_mode);
void kvm_ioapic_get_delivery_bitmask(struct kvm_ioapic *ioapic, u8 dest,
u8 dest_mode, unsigned long *mask);

#endif
5 changes: 3 additions & 2 deletions trunk/virt/kvm/irq_comm.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ void kvm_get_intr_delivery_bitmask(struct kvm_ioapic *ioapic,
{
struct kvm_vcpu *vcpu;

*deliver_bitmask = kvm_ioapic_get_delivery_bitmask(ioapic,
entry->fields.dest_id, entry->fields.dest_mode);
kvm_ioapic_get_delivery_bitmask(ioapic, entry->fields.dest_id,
entry->fields.dest_mode,
deliver_bitmask);
switch (entry->fields.delivery_mode) {
case IOAPIC_LOWEST_PRIORITY:
vcpu = kvm_get_lowest_prio_vcpu(ioapic->kvm,
Expand Down

0 comments on commit 48f8afc

Please sign in to comment.