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

[Xen-changelog] [xen-unstable] x86: use compat hypercall handlers for calls from 32-bit HVM guests



# HG changeset patch
# User Tim Deegan <Tim.Deegan@xxxxxxxxxx>
# Date 1305187998 -3600
# Node ID fabdd682420c0c7b5e81f07f2f54211ebc11babe
# Parent  1e29db7a3b6bcae442676ed52f574434cfe0aba7
x86: use compat hypercall handlers for calls from 32-bit HVM guests

On 64-bit Xen, hypercalls from 32-bit HVM guests are handled as
a special case, but not all the hypercalls are corrently redirected
to their compat-mode wrappers.  Use compat_* for xen_version,
sched_op and set_timer_op for consistency.

Signed-off-by: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
---


diff -r 1e29db7a3b6b -r fabdd682420c xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c    Thu May 12 09:07:35 2011 +0100
+++ b/xen/arch/x86/hvm/hvm.c    Thu May 12 09:13:18 2011 +0100
@@ -2911,15 +2911,18 @@
     HYPERCALL(tmem_op)
 };
 
+#define COMPAT_CALL(x)                                        \
+    [ __HYPERVISOR_ ## x ] = (hvm_hypercall_t *) compat_ ## x
+
 static hvm_hypercall_t *hvm_hypercall32_table[NR_hypercalls] = {
     [ __HYPERVISOR_memory_op ] = (hvm_hypercall_t *)hvm_memory_op_compat32,
     [ __HYPERVISOR_grant_table_op ] = (hvm_hypercall_t 
*)hvm_grant_table_op_compat32,
     [ __HYPERVISOR_vcpu_op ] = (hvm_hypercall_t *)hvm_vcpu_op_compat32,
     [ __HYPERVISOR_physdev_op ] = (hvm_hypercall_t *)hvm_physdev_op_compat32,
-    HYPERCALL(xen_version),
+    COMPAT_CALL(xen_version),
     HYPERCALL(event_channel_op),
-    HYPERCALL(sched_op),
-    HYPERCALL(set_timer_op),
+    COMPAT_CALL(sched_op),
+    COMPAT_CALL(set_timer_op),
     HYPERCALL(hvm_op),
     HYPERCALL(sysctl),
     HYPERCALL(tmem_op)
diff -r 1e29db7a3b6b -r fabdd682420c xen/include/xen/hypercall.h
--- a/xen/include/xen/hypercall.h       Thu May 12 09:07:35 2011 +0100
+++ b/xen/include/xen/hypercall.h       Thu May 12 09:13:18 2011 +0100
@@ -146,6 +146,20 @@
 extern int
 compat_xenoprof_op(int op, XEN_GUEST_HANDLE(void) arg);
 
+extern int
+compat_xen_version(
+    int cmd,
+    XEN_GUEST_HANDLE(void) arg);
+
+extern int
+compat_sched_op(
+    int cmd,
+    XEN_GUEST_HANDLE(void) arg);
+
+extern int
+compat_set_timer_op(
+    s_time_t timeout);
+
 #endif
 
 #endif /* __XEN_HYPERCALL_H__ */

_______________________________________________
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®.