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

[Xen-ia64-devel] Re: [Xen-devel] [PATCH 3/5] setup_irq/request_irq/free_

To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Subject: [Xen-ia64-devel] Re: [Xen-devel] [PATCH 3/5] setup_irq/request_irq/free_irq fixups
From: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Date: Thu, 12 Feb 2009 16:25:19 +0900
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Espen Skoglund <espen.skoglund@xxxxxxxxxxxxx>, xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 11 Feb 2009 23:25:26 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <C5B6C3FE.1790%keir.fraser@xxxxxxxxxxxxx>
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.6i
On Tue, Feb 10, 2009 at 05:41:18AM +0000, Keir Fraser wrote:
> On 09/02/2009 17:46, "Espen Skoglund" <espen.skoglund@xxxxxxxxxxxxx> wrote:
> 
> > Cleanup naming for ia64 and x86 interrupt handling functions
> > 
> > - Append '_IRQ' to AUTO_ASSIGN, NEVER_ASSIGN, and FREE_TO_ASSIGN
> > - Rename {request,setup}_irq to {request,setup}_irq_vector
> > - Rename free_irq to release_irq_vector
> > - Add {request,setup,release}_irq wrappers for their
> >   {request,setup,release}_irq_vector counterparts
> > - Added generic irq_to_vector inline for ia64
> > - Changed ia64 to use the new naming scheme
> > 
> > Signed-off-by: Espen Skoglund <espen.skoglund@xxxxxxxxxxxxx>
> 
> This needs an ack on the IA64 side. And perhaps a fixup patch since it
> probably breaks their build if you couldn't test that. I cc'ed Isaku.

Here is the additional patch to boot xen on ia64.

[IA64] more fix

tirivial compliation fix and fixes to boot xen on ia64.

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>

diff --git a/xen/arch/ia64/linux-xen/iosapic.c 
b/xen/arch/ia64/linux-xen/iosapic.c
--- a/xen/arch/ia64/linux-xen/iosapic.c
+++ b/xen/arch/ia64/linux-xen/iosapic.c
@@ -93,6 +93,7 @@
 #include <asm/ptrace.h>
 #include <asm/system.h>
 
+#ifdef XEN
 static inline int iosapic_irq_to_vector (int irq)
 {
        return irq;
@@ -100,6 +101,8 @@ static inline int iosapic_irq_to_vector 
 
 #undef irq_to_vector
 #define irq_to_vector(irq)      iosapic_irq_to_vector(irq)
+#define AUTO_ASSIGN    AUTO_ASSIGN_IRQ
+#endif
 
 #undef DEBUG_INTERRUPT_ROUTING
 
@@ -535,7 +538,7 @@ iosapic_reassign_vector (int vector)
        int new_vector;
 
        if (!list_empty(&iosapic_intr_info[vector].rtes)) {
-               new_vector = assign_irq_vector(AUTO_ASSIGN_IRQ);
+               new_vector = assign_irq_vector(AUTO_ASSIGN);
                if (new_vector < 0)
                        panic("%s: out of interrupt vectors!\n", __FUNCTION__);
                printk(KERN_INFO "Reassigning vector %d to %d\n", vector, 
new_vector);
@@ -771,7 +774,7 @@ again:
        spin_unlock_irqrestore(&iosapic_lock, flags);
 
        /* If vector is running out, we try to find a sharable vector */
-       vector = assign_irq_vector(AUTO_ASSIGN_IRQ);
+       vector = assign_irq_vector(AUTO_ASSIGN);
        if (vector < 0) {
                vector = iosapic_find_sharable_vector(trigger, polarity);
                if (vector < 0)
@@ -926,7 +929,7 @@ iosapic_register_platform_intr (u32 int_
                delivery = IOSAPIC_PMI;
                break;
              case ACPI_INTERRUPT_INIT:
-               vector = assign_irq_vector(AUTO_ASSIGN_IRQ);
+               vector = assign_irq_vector(AUTO_ASSIGN);
                if (vector < 0)
                        panic("%s: out of interrupt vectors!\n", __FUNCTION__);
                delivery = IOSAPIC_INIT;
diff --git a/xen/arch/ia64/linux-xen/irq_ia64.c 
b/xen/arch/ia64/linux-xen/irq_ia64.c
--- a/xen/arch/ia64/linux-xen/irq_ia64.c
+++ b/xen/arch/ia64/linux-xen/irq_ia64.c
@@ -250,6 +250,7 @@ void
 register_percpu_irq (ia64_vector vec, struct irqaction *action)
 {
        irq_desc_t *desc;
+#ifndef XEN
        unsigned int irq;
 
        for (irq = 0; irq < NR_IRQS; ++irq)
@@ -258,12 +259,15 @@ register_percpu_irq (ia64_vector vec, st
                        desc->status |= IRQ_PER_CPU;
                        desc->handler = &irq_type_ia64_lsapic;
                        if (action)
-#ifdef XEN
-                               setup_vector(irq, action);
+                               setup_irq(irq, action);
+               }
 #else
-                               setup_irq_vector(irq, action);
+       desc = irq_descp(vec);
+       desc->status |= IRQ_PER_CPU;
+       desc->handler = &irq_type_ia64_lsapic;
+       if (action)
+               setup_vector(vec, action);
 #endif
-               }
 }
 
 #ifdef XEN
diff --git a/xen/arch/ia64/linux-xen/mca.c b/xen/arch/ia64/linux-xen/mca.c
--- a/xen/arch/ia64/linux-xen/mca.c
+++ b/xen/arch/ia64/linux-xen/mca.c
@@ -1930,12 +1930,18 @@ ia64_mca_late_init(void)
                if (cpe_vector >= 0) {
                        /* If platform supports CPEI, enable the irq. */
                        cpe_poll_enabled = 0;
+#ifndef XEN
                        for (irq = 0; irq < NR_IRQS; ++irq)
                                if (irq_to_vector(irq) == cpe_vector) {
                                        desc = irq_descp(irq);
                                        desc->status |= IRQ_PER_CPU;
                                        setup_vector(irq, &mca_cpe_irqaction);
                                }
+#else
+                       desc = irq_descp(cpe_vector);
+                       desc->status |= IRQ_PER_CPU;
+                       setup_vector(cpe_vector, &mca_cpe_irqaction);
+#endif
                        ia64_mca_register_cpev(cpe_vector);
                        IA64_MCA_DEBUG("%s: CPEI/P setup and enabled.\n", 
__FUNCTION__);
                } else {
diff --git a/xen/arch/ia64/xen/hypercall.c b/xen/arch/ia64/xen/hypercall.c
--- a/xen/arch/ia64/xen/hypercall.c
+++ b/xen/arch/ia64/xen/hypercall.c
@@ -543,7 +543,7 @@ long do_physdev_op(int cmd, XEN_GUEST_HA
             break;
         irq_status_query.flags = 0;
         /* Edge-triggered interrupts don't need an explicit unmask downcall. */
-        if ( !strstr(irq_desc[irq_to_vector(irq)].handler->typename, "edge") )
+        if ( !strstr(irq_descp(irq)->handler->typename, "edge") )
             irq_status_query.flags |= XENIRQSTAT_needs_eoi;
         ret = copy_to_guest(arg, &irq_status_query, 1) ? -EFAULT : 0;
         break;
diff --git a/xen/arch/ia64/xen/irq.c b/xen/arch/ia64/xen/irq.c
--- a/xen/arch/ia64/xen/irq.c
+++ b/xen/arch/ia64/xen/irq.c
@@ -262,7 +262,7 @@ int setup_irq_vector(unsigned int vec, s
 {
        int res;
 
-       if ( !vec )
+       if ( vec == IA64_INVALID_VECTOR )
                return -ENOSYS;
        /* Reserve the vector (and thus the irq).  */
        if (test_and_set_bit(vec, ia64_xen_vector))
@@ -276,7 +276,7 @@ void release_irq_vector(unsigned int vec
        unsigned long flags;
        irq_desc_t *desc;
 
-       if ( !vec )
+       if ( vec == IA64_INVALID_VECTOR )
                return;
 
        desc = irq_descp(vec);
diff --git a/xen/include/asm-ia64/hvm/irq.h b/xen/include/asm-ia64/hvm/irq.h
--- a/xen/include/asm-ia64/hvm/irq.h
+++ b/xen/include/asm-ia64/hvm/irq.h
@@ -90,10 +90,11 @@ struct hvm_irq {
 #define hvm_pci_intx_link(dev, intx) \
     (((dev) + (intx)) & 3)
 
-static inlint int irq_to_vector(int irq)
+#define IA64_INVALID_VECTOR    ((unsigned int)((int)-1))
+static inline unsigned int irq_to_vector(int irq)
 {
     int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
-    int vector;
+    unsigned int vector;
 
     if ( acpi_gsi_to_irq(irq, &vector) < 0)
         return 0;


-- 
yamahata

_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel