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
|