return rc;
}
-static int grant_table_op_is_allowed(unsigned int cmd)
+static long hvm_grant_table_op(
+ unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) uop, unsigned int count)
{
- switch (cmd) {
+ switch ( cmd )
+ {
case GNTTABOP_query_size:
case GNTTABOP_setup_table:
case GNTTABOP_set_version:
case GNTTABOP_map_grant_ref:
case GNTTABOP_unmap_grant_ref:
case GNTTABOP_swap_grant_ref:
- return 1;
- default:
- /* all other commands need auditing */
- return 0;
+ break;
+
+ default: /* All other commands need auditing. */
+ return -ENOSYS;
}
-}
-static long hvm_grant_table_op(
- unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) uop, unsigned int count)
-{
- if ( !grant_table_op_is_allowed(cmd) )
- return -ENOSYS; /* all other commands need auditing */
- return do_grant_table_op(cmd, uop, count);
+ if ( current->arch.hvm_vcpu.hcall_64bit )
+ return do_grant_table_op(cmd, uop, count);
+ else
+ return compat_grant_table_op(cmd, uop, count);
}
static long hvm_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
}
}
-static long hvm_grant_table_op_compat32(unsigned int cmd,
- XEN_GUEST_HANDLE_PARAM(void) uop,
- unsigned int count)
-{
- if ( !grant_table_op_is_allowed(cmd) )
- return -ENOSYS;
- return compat_grant_table_op(cmd, uop, count);
-}
-
static long hvm_physdev_op_compat32(
int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
{
#define do_physdev_op hvm_physdev_op
#define compat_physdev_op hvm_physdev_op_compat32
-#define do_grant_table_op hvm_grant_table_op
-#define compat_grant_table_op hvm_grant_table_op_compat32
#define do_arch_1 paging_domctl_continuation
static const hypercall_table_t hvm_hypercall_table[] = {
HVM_CALL(memory_op),
- COMPAT_CALL(grant_table_op),
+ HVM_CALL(grant_table_op),
COMPAT_CALL(vcpu_op),
COMPAT_CALL(physdev_op),
COMPAT_CALL(xen_version),
#undef do_physdev_op
#undef compat_physdev_op
-#undef do_grant_table_op
-#undef compat_grant_table_op
#undef do_arch_1
#undef HYPERCALL