[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [IA64] implement free_irq_vector() paravirtualization



# HG changeset patch
# User awilliam@xxxxxxxxxxxx
# Node ID 4f1a3ae07dbc11683f2f8064449c96aa590112b1
# Parent  d901f2fe8c25c149b4ac945cd202562aa194b857
[IA64] implement free_irq_vector() paravirtualization

This avoids a double free error message since dom0 isn't
actually using the ia64_vector_mask.

Signed-off-by: Akio Takebe <takebe_akio@xxxxxxxxxxxxxx>
---
 linux-2.6-xen-sparse/arch/ia64/kernel/iosapic.c  |   10 ++++++++++
 linux-2.6-xen-sparse/arch/ia64/kernel/irq_ia64.c |    7 +++++++
 xen/arch/ia64/xen/hypercall.c                    |   23 +++++++++++++++++++++++
 xen/include/public/physdev.h                     |    1 +
 4 files changed, 41 insertions(+)

diff -r d901f2fe8c25 -r 4f1a3ae07dbc 
linux-2.6-xen-sparse/arch/ia64/kernel/iosapic.c
--- a/linux-2.6-xen-sparse/arch/ia64/kernel/iosapic.c   Wed Dec 06 02:34:46 
2006 -0700
+++ b/linux-2.6-xen-sparse/arch/ia64/kernel/iosapic.c   Thu Dec 07 04:15:54 
2006 -0700
@@ -197,6 +197,16 @@ int xen_assign_irq_vector(int irq)
 
        return irq_op.vector;
 }
+
+void xen_free_irq_vector(int vector)
+{
+       struct physdev_irq irq_op;
+
+       irq_op.vector = vector;
+       if (HYPERVISOR_physdev_op(PHYSDEVOP_free_irq_vector, &irq_op))
+               printk(KERN_WARNING "%s: xen_free_irq_vecotr fail vector=%d\n",
+                      __FUNCTION__, vector);
+}
 #endif /* XEN */
 
 /*
diff -r d901f2fe8c25 -r 4f1a3ae07dbc 
linux-2.6-xen-sparse/arch/ia64/kernel/irq_ia64.c
--- a/linux-2.6-xen-sparse/arch/ia64/kernel/irq_ia64.c  Wed Dec 06 02:34:46 
2006 -0700
+++ b/linux-2.6-xen-sparse/arch/ia64/kernel/irq_ia64.c  Thu Dec 07 04:15:54 
2006 -0700
@@ -94,6 +94,13 @@ free_irq_vector (int vector)
        if (vector < IA64_FIRST_DEVICE_VECTOR || vector > 
IA64_LAST_DEVICE_VECTOR)
                return;
 
+#ifdef CONFIG_XEN
+       if (is_running_on_xen()) {
+               extern void xen_free_irq_vector(int);
+               xen_free_irq_vector(vector);
+               return;
+       }
+#endif
        pos = vector - IA64_FIRST_DEVICE_VECTOR;
        if (!test_and_clear_bit(pos, ia64_vector_mask))
                printk(KERN_WARNING "%s: double free!\n", __FUNCTION__);
diff -r d901f2fe8c25 -r 4f1a3ae07dbc xen/arch/ia64/xen/hypercall.c
--- a/xen/arch/ia64/xen/hypercall.c     Wed Dec 06 02:34:46 2006 -0700
+++ b/xen/arch/ia64/xen/hypercall.c     Thu Dec 07 04:15:54 2006 -0700
@@ -454,6 +454,29 @@ static long do_physdev_op(int cmd, XEN_G
         break;
     }
 
+    case PHYSDEVOP_free_irq_vector: {
+        struct physdev_irq irq_op;
+        int vector;
+
+        ret = -EFAULT;
+        if ( copy_from_guest(&irq_op, arg, 1) != 0 )
+            break;
+
+        ret = -EPERM;
+        if ( !IS_PRIV(current->domain) )
+            break;
+
+        ret = -EINVAL;
+        vector = irq_op.vector;
+        if (vector < IA64_FIRST_DEVICE_VECTOR ||
+            vector > IA64_LAST_DEVICE_VECTOR)
+            break;
+        
+        free_irq_vector(vector);
+        ret = 0;
+        break;
+    }
+
     default:
         ret = -ENOSYS;
         break;
diff -r d901f2fe8c25 -r 4f1a3ae07dbc xen/include/public/physdev.h
--- a/xen/include/public/physdev.h      Wed Dec 06 02:34:46 2006 -0700
+++ b/xen/include/public/physdev.h      Thu Dec 07 04:15:54 2006 -0700
@@ -152,6 +152,7 @@ DEFINE_XEN_GUEST_HANDLE(physdev_op_t);
 #define PHYSDEVOP_APIC_READ              PHYSDEVOP_apic_read
 #define PHYSDEVOP_APIC_WRITE             PHYSDEVOP_apic_write
 #define PHYSDEVOP_ASSIGN_VECTOR          PHYSDEVOP_alloc_irq_vector
+#define PHYSDEVOP_FREE_VECTOR            PHYSDEVOP_free_irq_vector
 #define PHYSDEVOP_IRQ_NEEDS_UNMASK_NOTIFY XENIRQSTAT_needs_eoi
 #define PHYSDEVOP_IRQ_SHARED             XENIRQSTAT_shared
 

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.