WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

RE: [Xen-devel] [PATCH] Fix legacy irq allocation issue

To: Jan Beulich <JBeulich@xxxxxxxxxx>
Subject: RE: [Xen-devel] [PATCH] Fix legacy irq allocation issue
From: "Jiang, Yunhong" <yunhong.jiang@xxxxxxxxx>
Date: Fri, 19 Jun 2009 16:13:53 +0800
Accept-language: en-US
Acceptlanguage: en-US
Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Delivery-date: Fri, 19 Jun 2009 01:15:48 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4A3B5D4A0200007800006AAC@xxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <E2263E4A5B2284449EEBD0AAB751098402CBA34177@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <4A3B5D4A0200007800006AAC@xxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcnwsWEtNbzCmHBmQZS8O4wHAi1N3gAASjCA
Thread-topic: [Xen-devel] [PATCH] Fix legacy irq allocation issue
Jan Beulich wrote:
>>>> "Jiang, Yunhong" <yunhong.jiang@xxxxxxxxx> 19.06.09 04:03 >>>
>> When try to assign vector for irq, we should not assign
> vector for legacy irq, which has fixed mapped irq<->vector
> relationship. 
> 
> What code path does get us there?
> 
>> --- a/xen/arch/x86/irq.c    Sun Jun 14 23:12:24 2009 +0800
>> +++ b/xen/arch/x86/irq.c    Wed Jun 17 08:51:43 2009 +0800
>> @@ -83,6 +83,12 @@ int assign_irq_vector(int irq)
>>     BUG_ON(irq >= nr_irqs && irq != AUTO_ASSIGN_IRQ);
>> 
>>     spin_lock(&vector_lock);
>> +
>> +    if ((irq != AUTO_ASSIGN_IRQ) && !IO_APIC_IRQ(irq)) +    {
>> +        spin_unlock(&vector_lock);
>> +        return LEGACY_VECTOR(irq);
>> +    }
> 
> If this is really needed, then why not simply exchange the following
> uses of IO_APIC_VECTOR() to irq_to_vector(), which already properly
> considers legacy vectors? 

Aha, yes. I should use that.

This is needed if dom0 try to assign a vector to legacy irq. I find this when 
help debugging one system. I don't have the broken system, so I have no idea 
why dom0 will try to assign vector to legacy irq. But from API point of view, I 
think this check is needed.
 
--jyh

> 
>> 
>>     if ((irq != AUTO_ASSIGN_IRQ) && (IO_APIC_VECTOR(irq) > 0)) {
>>         spin_unlock(&vector_lock);
> 
> Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel