diff options
author | Tim Deegan <Tim.Deegan@citrix.com> | 2011-05-12 09:19:29 +0100 |
---|---|---|
committer | Tim Deegan <Tim.Deegan@citrix.com> | 2011-05-12 09:19:29 +0100 |
commit | e8234cc8ce43d70a7c23ece675b3611eb4d8a0eb (patch) | |
tree | 0ed36627a7d1e2cda272d21b0ebc7080302aa5ad | |
parent | ae624070a3fb82232fc9edd7f9b081138988128d (diff) | |
download | xen-e8234cc8ce43d70a7c23ece675b3611eb4d8a0eb.tar.gz xen-e8234cc8ce43d70a7c23ece675b3611eb4d8a0eb.tar.bz2 xen-e8234cc8ce43d70a7c23ece675b3611eb4d8a0eb.zip |
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@citrix.com>
xen-unstable changeset: 23333:fabdd682420c
xen-unstable date: Thu May 12 09:13:18 2011 +0100
-rw-r--r-- | xen/arch/x86/hvm/hvm.c | 9 | ||||
-rw-r--r-- | xen/include/xen/hypercall.h | 14 |
2 files changed, 20 insertions, 3 deletions
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 11f9392d60..82aecbcc6c 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -2679,15 +2679,18 @@ static hvm_hypercall_t *hvm_hypercall64_table[NR_hypercalls] = { 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 --git a/xen/include/xen/hypercall.h b/xen/include/xen/hypercall.h index 3e1ada4bc9..40900a2001 100644 --- a/xen/include/xen/hypercall.h +++ b/xen/include/xen/hypercall.h @@ -146,6 +146,20 @@ compat_vcpu_op( 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__ */ |