diff options
author | Yang Zhang <yang.z.zhang@Intel.com> | 2013-04-06 20:25:18 -0400 |
---|---|---|
committer | Gleb Natapov <gleb@redhat.com> | 2013-04-07 06:55:49 -0400 |
commit | 44944d4d28948c71b110b09a2e924e505cd39e8b (patch) | |
tree | 6d0b96165c11414c98edd14501f016627687d7dd /virt/kvm/ioapic.c | |
parent | 99437a2782730ec8c7e6cfebb6143d00b091e4a8 (diff) |
KVM: Call kvm_apic_match_dest() to check destination vcpu
For a given vcpu, kvm_apic_match_dest() will tell you whether
the vcpu in the destination list quickly. Drop kvm_calculate_eoi_exitmap()
and use kvm_apic_match_dest() instead.
Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Diffstat (limited to 'virt/kvm/ioapic.c')
-rw-r--r-- | virt/kvm/ioapic.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c index 5ba005c00e2f..914cbe027d06 100644 --- a/virt/kvm/ioapic.c +++ b/virt/kvm/ioapic.c | |||
@@ -124,7 +124,6 @@ void kvm_ioapic_calculate_eoi_exitmap(struct kvm_vcpu *vcpu, | |||
124 | { | 124 | { |
125 | struct kvm_ioapic *ioapic = vcpu->kvm->arch.vioapic; | 125 | struct kvm_ioapic *ioapic = vcpu->kvm->arch.vioapic; |
126 | union kvm_ioapic_redirect_entry *e; | 126 | union kvm_ioapic_redirect_entry *e; |
127 | struct kvm_lapic_irq irqe; | ||
128 | int index; | 127 | int index; |
129 | 128 | ||
130 | spin_lock(&ioapic->lock); | 129 | spin_lock(&ioapic->lock); |
@@ -135,11 +134,9 @@ void kvm_ioapic_calculate_eoi_exitmap(struct kvm_vcpu *vcpu, | |||
135 | (e->fields.trig_mode == IOAPIC_LEVEL_TRIG || | 134 | (e->fields.trig_mode == IOAPIC_LEVEL_TRIG || |
136 | kvm_irq_has_notifier(ioapic->kvm, KVM_IRQCHIP_IOAPIC, | 135 | kvm_irq_has_notifier(ioapic->kvm, KVM_IRQCHIP_IOAPIC, |
137 | index))) { | 136 | index))) { |
138 | irqe.dest_id = e->fields.dest_id; | 137 | if (kvm_apic_match_dest(vcpu, NULL, 0, |
139 | irqe.vector = e->fields.vector; | 138 | e->fields.dest_id, e->fields.dest_mode)) |
140 | irqe.dest_mode = e->fields.dest_mode; | 139 | __set_bit(e->fields.vector, (unsigned long *)eoi_exit_bitmap); |
141 | irqe.delivery_mode = e->fields.delivery_mode << 8; | ||
142 | kvm_calculate_eoi_exitmap(vcpu, &irqe, eoi_exit_bitmap); | ||
143 | } | 140 | } |
144 | } | 141 | } |
145 | spin_unlock(&ioapic->lock); | 142 | spin_unlock(&ioapic->lock); |