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

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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [IA64] implement free_irq_vector() paravirtualization
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 09 Dec 2006 15:45:00 +0000
Delivery-date: Sat, 09 Dec 2006 07:47:34 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [IA64] implement free_irq_vector() paravirtualization, Xen patchbot-unstable <=