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: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>, 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 17:03:37 +0800
Accept-language: en-US
Acceptlanguage: en-US
Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 19 Jun 2009 02:13:35 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <C6610A55.DBA1%keir.fraser@xxxxxxxxxxxxx>
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: <E2263E4A5B2284449EEBD0AAB751098402CBA344F2@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <C6610A55.DBA1%keir.fraser@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcnwsWEtNbzCmHBmQZS8O4wHAi1N3gAASjCAAAFJFRQAAIIyQA==
Thread-topic: [Xen-devel] [PATCH] Fix legacy irq allocation issue
The followed is based on old patch. Jan, is this ok?
Signed-off-by: Jiang, Yunhong <yunhong.jiang@xxxxxxxxx>

BTW, when I working on this, I'm abit confused of the irq. I'm not sure if I 
can assume irq is mainly for IOAPIC/PIC (i.e. something like gsi and is 
global), while pirq is just physical irq (i.e. including both gsi/MSI irq)? 

 If yes, what's the irq in PHYSDEVOP_alloc_irq_vector()? It is in fact dom0's 
irq, however, in assign_irq_vector(), seems it is treated same as Xen's irq. I 
remember I understood that part when I begin working on MSI, but seems I fogot 
the answer now :$

 (seems this is also discussed in mailint list when talking about pv_ops dom0).

Thanks
Yunhong Jiang


diff -r 880c27f9e2db xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c        Fri Jun 19 02:56:20 2009 +0800
+++ b/xen/arch/x86/irq.c        Fri Jun 19 02:56:38 2009 +0800
@@ -84,15 +84,9 @@ int assign_irq_vector(int irq)

     spin_lock(&vector_lock);

-    if ((irq != AUTO_ASSIGN_IRQ) && !IO_APIC_IRQ(irq))
-    {
+    if ((irq != AUTO_ASSIGN_IRQ) && (irq_to_vector(irq) > 0)) {
         spin_unlock(&vector_lock);
-        return LEGACY_VECTOR(irq);
-    }
-
-    if ((irq != AUTO_ASSIGN_IRQ) && (IO_APIC_VECTOR(irq) > 0)) {
-        spin_unlock(&vector_lock);
-        return IO_APIC_VECTOR(irq);
+        return irq_to_vector(irq);
     }

     vector = current_vector;



Keir Fraser wrote:
> On 19/06/2009 09:13, "Jiang, Yunhong" <yunhong.jiang@xxxxxxxxx> wrote:
> 
>>> 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.
> 
> A patch to apply on top of the old patch then, please.
> 
> K.
> 
>> 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. 
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel