From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 1/8 v2] Change irq routing table to use gsi indexed array. Date: Wed, 12 Aug 2009 12:06:05 +0300 Message-ID: <4A8285FD.3060409@redhat.com> References: <1249993895-11119-1-git-send-email-gleb@redhat.com> <1249993895-11119-2-git-send-email-gleb@redhat.com> <4A8277B2.8010008@redhat.com> <20090812084114.GX4764@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Gleb Natapov Return-path: Received: from mx2.redhat.com ([66.187.237.31]:60321 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754911AbZHLJGH (ORCPT ); Wed, 12 Aug 2009 05:06:07 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7C968RB019616 for ; Wed, 12 Aug 2009 05:06:08 -0400 In-Reply-To: <20090812084114.GX4764@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 08/12/2009 11:41 AM, Gleb Natapov wrote: > 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. But one gsi can be mapped to multiple irqchip/pin combinations. > Besides > this is what the current code does. > The current code stops on first match; the new code doesn't consider some entries at all. -- error compiling committee.c: too many arguments to function