| 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
 |