kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: Avi Kivity <avi@redhat.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH 2/8 v2] Maintain back mapping from irqchip/pin to gsi.
Date: Wed, 12 Aug 2009 11:42:45 +0300	[thread overview]
Message-ID: <20090812084245.GY4764@redhat.com> (raw)
In-Reply-To: <4A8278D6.7080102@redhat.com>

On Wed, Aug 12, 2009 at 11:09:58AM +0300, Avi Kivity wrote:
> On 08/11/2009 03:31 PM, Gleb Natapov wrote:
>> Maintain back mapping from irqchip/pin to gsi to speedup
>> interrupt acknowledgment notifications.
>>
>> Signed-off-by: Gleb Natapov<gleb@redhat.com>
>> ---
>>   include/linux/kvm_host.h |    1 +
>>   virt/kvm/irq_comm.c      |   24 +++++++++++-------------
>>   2 files changed, 12 insertions(+), 13 deletions(-)
>>
>> diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
>> index 09df31d..d2b8eb3 100644
>> --- a/include/linux/kvm_host.h
>> +++ b/include/linux/kvm_host.h
>> @@ -133,6 +133,7 @@ struct kvm_kernel_irq_routing_entry {
>>   };
>>
>>   struct kvm_irq_routing_table {
>> +	int chip[3][KVM_IOAPIC_NUM_PINS];
>>    
>
> KVM_NR_IRQCHIPS
>
> An alternative implementation is to embed a lookup table in each  
> irqchip.  I don't think it's really necessary.
>
>> --- a/virt/kvm/irq_comm.c
>> +++ b/virt/kvm/irq_comm.c
>> @@ -168,21 +168,13 @@ 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;
>> -		}
>> -	}
>> +	gsi = kvm->irq_routing->chip[irqchip][pin];
>> +	if (gsi == -1)
>> +		gsi = pin;
>>    
>
> What's this?
>
If there is not GSI mapping use pin as gsi. This what current code does.
We can BUG() here I think.

--
			Gleb.

  reply	other threads:[~2009-08-12  8:42 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-11 12:31 [PATCH 0/8 v2] make interrupt injection lockless (almost) Gleb Natapov
2009-08-11 12:31 ` [PATCH 1/8 v2] Change irq routing table to use gsi indexed array Gleb Natapov
2009-08-12  8:05   ` Avi Kivity
2009-08-12  8:41     ` Gleb Natapov
2009-08-12  9:06       ` Avi Kivity
2009-08-11 12:31 ` [PATCH 2/8 v2] Maintain back mapping from irqchip/pin to gsi Gleb Natapov
2009-08-12  8:09   ` Avi Kivity
2009-08-12  8:42     ` Gleb Natapov [this message]
2009-08-12  9:06       ` Avi Kivity
2009-08-12 10:17         ` Gleb Natapov
2009-08-12 10:19           ` Avi Kivity
2009-08-11 12:31 ` [PATCH 3/8 v2] Move irq routing data structure to rcu locking Gleb Natapov
2009-08-11 12:31 ` [PATCH 4/8 v2] Move irq ack notifier list to arch independent code Gleb Natapov
2009-08-11 12:31 ` [PATCH 5/8 v2] Convert irq notifiers lists to RCU locking Gleb Natapov
2009-08-11 12:31 ` [PATCH 6/8 v2] Move IO APIC to its own lock Gleb Natapov
2009-08-12  8:27   ` Avi Kivity
2009-08-12  9:04     ` Gleb Natapov
2009-08-12  9:18       ` Avi Kivity
2009-08-12  9:47         ` Gleb Natapov
2009-08-12  9:57           ` Avi Kivity
2009-08-12 10:05             ` Gleb Natapov
2009-08-12 10:07               ` Avi Kivity
2009-08-11 12:31 ` [PATCH 7/8 v2] Drop kvm->irq_lock lock from irq injection path Gleb Natapov
2009-08-11 12:31 ` [PATCH 8/8 v2] Change irq_lock from mutex to spinlock Gleb Natapov
2009-08-12  8:29   ` Avi Kivity
2009-08-12  9:11     ` Gleb Natapov
2009-08-12  9:22       ` Avi Kivity
2009-08-12  9:47         ` Gleb Natapov

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=20090812084245.GY4764@redhat.com \
    --to=gleb@redhat.com \
    --cc=avi@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).