On Wed, Aug 12, 2009 at 11:05:06AM +0300, Avi Kivity wrote: > On 08/11/2009 03:31 PM, Gleb Natapov wrote: >> Use gsi indexed array instead of scanning all entries on each interrupt >> injection. >> >> >> @@ -163,20 +166,23 @@ int kvm_set_irq(struct kvm *kvm, int irq_source_id, int irq, int level) >> >> void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin) >> { >> - struct kvm_kernel_irq_routing_entry *e; >> struct kvm_irq_ack_notifier *kian; >> struct hlist_node *n; >> unsigned gsi = pin; >> + int i; >> >> trace_kvm_ack_irq(irqchip, pin); >> >> - list_for_each_entry(e,&kvm->irq_routing, link) >> + for (i = 0; i< kvm->irq_routing->nr_rt_entries; i++) { >> + struct kvm_kernel_irq_routing_entry *e; >> + e =&kvm->irq_routing->rt_entries[i]; >> if (e->type == KVM_IRQ_ROUTING_IRQCHIP&& >> e->irqchip.irqchip == irqchip&& >> e->irqchip.pin == pin) { >> gsi = e->gsi; >> break; >> } >> + } >> > > Don't you need to iterate over all the entries for a gsi? > One pin/irqchip cannot be mapped to more than one GSI. Besides this is what the current code does. -- Gleb. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html