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

[Xen-ia64-devel] [PATCH] xencomm support for multi call with physdev_op

To: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-ia64-devel] [PATCH] xencomm support for multi call with physdev_op and event_channel_op.
From: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Date: Tue, 2 Dec 2008 17:19:07 +0900
Delivery-date: Tue, 02 Dec 2008 00:19:13 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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
IA64: xencomm support for multi call with physdev_op and event_channel_op.

Recently the c/s of d545a95fca73 makes use of multi call
with __HYPERVISOR_event_channel_op and __HYPERVISOR_physdev_op.
This patch adds support of those hypercall.

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

diff --git a/arch/ia64/xen/xcom_hcall.c b/arch/ia64/xen/xcom_hcall.c
--- a/arch/ia64/xen/xcom_hcall.c
+++ b/arch/ia64/xen/xcom_hcall.c
@@ -70,13 +70,27 @@ xencomm_hypercall_console_io(int cmd, in
 }
 EXPORT_SYMBOL_GPL(xencomm_hypercall_console_io);
 
+static int
+xencommize_event_channel_op(struct xencomm_mini **xc_area, void *op,
+                           struct xencomm_handle **desc)
+{
+       *desc = __xencomm_map_no_alloc(op, sizeof(evtchn_op_t), *xc_area);
+       if (*desc == NULL)
+               return -EINVAL;
+       (*xc_area)++;
+       return 0;
+}
+
 int
 xencomm_hypercall_event_channel_op(int cmd, void *op)
 {
+       int rc;
        struct xencomm_handle *desc;
-       desc = xencomm_map_no_alloc(op, sizeof(evtchn_op_t));
-       if (desc == NULL)
-               return -EINVAL;
+       XENCOMM_MINI_ALIGNED(xc_area, 2);
+
+       rc = xencommize_event_channel_op(&xc_area, op, &desc);
+       if (rc)
+               return rc;
 
        return xencomm_arch_hypercall_event_channel_op(cmd, desc);
 }
@@ -127,8 +141,9 @@ xencomm_hypercall_xen_version(int cmd, v
 }
 EXPORT_SYMBOL_GPL(xencomm_hypercall_xen_version);
 
-int
-xencomm_hypercall_physdev_op(int cmd, void *op)
+static int
+xencommize_physdev_op(struct xencomm_mini **xc_area, int cmd, void *op,
+                     struct xencomm_handle **desc)
 {
        unsigned int argsize;
        
@@ -159,9 +174,26 @@ xencomm_hypercall_physdev_op(int cmd, vo
                printk("%s: unknown physdev op %d\n", __func__, cmd);
                return -ENOSYS;
        }
-       
-       return xencomm_arch_hypercall_physdev_op
-               (cmd, xencomm_map_no_alloc(op, argsize));
+
+       *desc = __xencomm_map_no_alloc(op, argsize, *xc_area);
+       if (*desc == NULL)
+               return -EINVAL;
+       (*xc_area)++;
+       return 0;
+}
+
+int
+xencomm_hypercall_physdev_op(int cmd, void *op)
+{
+       int rc;
+       struct xencomm_handle *desc;
+       XENCOMM_MINI_ALIGNED(xc_area, 2);
+
+       rc = xencommize_physdev_op(&xc_area, cmd, op, &desc);
+       if (rc)
+               return rc;
+
+       return xencomm_arch_hypercall_physdev_op(cmd, desc);
 }
 
 static int
@@ -319,6 +351,34 @@ xencomm_hypercall_multicall(void *call_l
                        if (rc)
                                return rc;
                        mce->args[1] = (unsigned long)desc;
+                       break;
+               case __HYPERVISOR_event_channel_op:
+                       rc = xencommize_event_channel_op(&xc_area,
+                                                        (void *)mce->args[1],
+                                                        &desc);
+                       if (rc)
+                               return rc;
+                       mce->args[1] = (unsigned long)desc;
+                       break;
+               case __HYPERVISOR_physdev_op:
+                       switch (mce->args[0]) {
+                       case PHYSDEVOP_eoi: {
+                               struct physdev_eoi *eoi =
+                                       (struct physdev_eoi *)mce->args[1];
+                               mce->op = __HYPERVISOR_ia64_fast_eoi;
+                               mce->args[0] = eoi->irq;
+                               break;
+                       }
+                       default:
+                               rc = xencommize_physdev_op(&xc_area,
+                                                          mce->args[0],
+                                                          (void *)mce->args[1],
+                                                          &desc);
+                               if (rc)
+                                       return rc;
+                               mce->args[1] = (unsigned long)desc;
+                               break;
+                       }
                        break;
                case __HYPERVISOR_memory_op:
                default:


-- 
yamahata

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-ia64-devel] [PATCH] xencomm support for multi call with physdev_op and event_channel_op., Isaku Yamahata <=