kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Gleb Natapov <gleb@redhat.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH v3 3/8] Maintain back mapping from irqchip/pin to gsi.
Date: Mon, 17 Aug 2009 12:43:57 +0300	[thread overview]
Message-ID: <4A89265D.6030706@redhat.com> (raw)
In-Reply-To: <1250079442-5163-4-git-send-email-gleb@redhat.com>

On 08/12/2009 03:17 PM, Gleb Natapov wrote:
> Maintain back mapping from irqchip/pin to gsi to speedup
> interrupt acknowledgment notifications.
>
>
>   struct kvm_irq_routing_table {
> +	int chip[KVM_NR_IRQCHIPS][KVM_IOAPIC_NUM_PINS];
>   	struct kvm_kernel_irq_routing_entry *rt_entries;
>   	u32 nr_rt_entries;
>   	/*
> diff --git a/virt/kvm/irq_comm.c b/virt/kvm/irq_comm.c
> index a9d2262..00e4be7 100644
> --- a/virt/kvm/irq_comm.c
> +++ b/virt/kvm/irq_comm.c
> @@ -168,25 +168,16 @@ void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin)
>   {
>   	struct kvm_irq_ack_notifier *kian;
>   	struct hlist_node *n;
> -	unsigned gsi = pin;
> -	int i;
> +	unsigned gsi;
>
>   	trace_kvm_ack_irq(irqchip, pin);
>
> -	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;
> -		}
> -	}
> -
> -	hlist_for_each_entry(kian, n,&kvm->arch.irq_ack_notifier_list, link)
> -		if (kian->gsi == gsi)
> -			kian->irq_acked(kian);
> +	gsi = kvm->irq_routing->chip[irqchip][pin];
> +	if (gsi != -1)
>    

unsigned vs. int compare... it will work, but will raise eyebrows.  
Better make it a -1U.

> +		hlist_for_each_entry(kian, n,&kvm->arch.irq_ack_notifier_list,
> +				     link)
> +			if (kian->gsi == gsi)
> +				kian->irq_acked(kian);
>   }
>
>   void kvm_register_irq_ack_notifier(struct kvm *kvm,
> @@ -308,6 +299,9 @@ static int setup_routing_entry(struct kvm_irq_routing_table *rt,
>   		}
>   		e->irqchip.irqchip = ue->u.irqchip.irqchip;
>   		e->irqchip.pin = ue->u.irqchip.pin + delta;
> +		if (e->irqchip.pin>  KVM_IOAPIC_NUM_PINS)
> +			goto out;
>    

 >=

-- 
error compiling committee.c: too many arguments to function


  reply	other threads:[~2009-08-17  9:43 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-12 12:17 [PATCH v3 0/8] make interrupt injection lockless (almost) Gleb Natapov
2009-08-12 12:17 ` [PATCH v3 1/8] Do not call ack notifiers on PIC reset Gleb Natapov
2009-08-13  9:11   ` Marcelo Tosatti
2009-08-13  9:39     ` Gleb Natapov
2009-08-12 12:17 ` [PATCH v3 2/8] Change irq routing table to use gsi indexed array Gleb Natapov
2009-08-12 12:17 ` [PATCH v3 3/8] Maintain back mapping from irqchip/pin to gsi Gleb Natapov
2009-08-17  9:43   ` Avi Kivity [this message]
2009-08-12 12:17 ` [PATCH v3 4/8] Move irq routing data structure to rcu locking Gleb Natapov
2009-08-12 12:17 ` [PATCH v3 5/8] Move irq ack notifier list to arch independent code Gleb Natapov
2009-08-12 12:17 ` [PATCH v3 6/8] Convert irq notifiers lists to RCU locking Gleb Natapov
2009-08-12 12:17 ` [PATCH v3 7/8] Move IO APIC to its own lock Gleb Natapov
2009-08-13  9:13   ` Marcelo Tosatti
2009-08-13  9:48     ` Gleb Natapov
2009-08-13  9:49       ` Avi Kivity
2009-08-13 10:09         ` Gleb Natapov
2009-08-13 10:44           ` Avi Kivity
2009-08-13 15:15             ` Paul E. McKenney
2009-08-12 12:17 ` [PATCH v3 8/8] Drop kvm->irq_lock lock from irq injection path Gleb Natapov
2009-08-17  9:46 ` [PATCH v3 0/8] make interrupt injection lockless (almost) Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A89265D.6030706@redhat.com \
    --to=avi@redhat.com \
    --cc=gleb@redhat.com \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).