ia64/xen-unstable

changeset 9975:e502007031f4

[IA64] linux: grant table hypercall work around

Current xen/ia64 grant table ignores some GNTMAP_xxx flags.
work around for that. This patch will be removed once the flags are supported.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author awilliam@xenbuild.aw
date Tue May 09 11:41:06 2006 -0600 (2006-05-09)
parents 423bee635129
children fc75a2c9835e
files linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c linux-2.6-xen-sparse/include/asm-ia64/hypercall.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c	Tue May 09 11:40:00 2006 -0600
     1.2 +++ b/linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c	Tue May 09 11:41:06 2006 -0600
     1.3 @@ -201,6 +201,59 @@ out:
     1.4  
     1.5  
     1.6  ///////////////////////////////////////////////////////////////////////////
     1.7 +// grant table hack
     1.8 +// cmd: GNTTABOP_xxx
     1.9 +
    1.10 +#include <linux/mm.h>
    1.11 +#include <xen/interface/xen.h>
    1.12 +#include <xen/gnttab.h>
    1.13 +
    1.14 +static void
    1.15 +gnttab_map_grant_ref_pre(struct gnttab_map_grant_ref *uop)
    1.16 +{
    1.17 +	uint32_t flags;
    1.18 +
    1.19 +	flags = uop->flags;
    1.20 +	if (flags & GNTMAP_readonly) {
    1.21 +#if 0
    1.22 +		xprintd("GNTMAP_readonly is not supported yet\n");
    1.23 +#endif
    1.24 +		flags &= ~GNTMAP_readonly;
    1.25 +	}
    1.26 +
    1.27 +	if (flags & GNTMAP_host_map) {
    1.28 +		if (flags & GNTMAP_application_map) {
    1.29 +			xprintd("GNTMAP_application_map is not supported yet: flags 0x%x\n", flags);
    1.30 +			BUG();
    1.31 +		}
    1.32 +		if (flags & GNTMAP_contains_pte) {
    1.33 +			xprintd("GNTMAP_contains_pte is not supported yet flags 0x%x\n", flags);
    1.34 +			BUG();
    1.35 +		}
    1.36 +	} else if (flags & GNTMAP_device_map) {
    1.37 +		xprintd("GNTMAP_device_map is not supported yet 0x%x\n", flags);
    1.38 +		BUG();//XXX not yet. actually this flag is not used.
    1.39 +	} else {
    1.40 +		BUG();
    1.41 +	}
    1.42 +}
    1.43 +
    1.44 +int
    1.45 +HYPERVISOR_grant_table_op(unsigned int cmd, void *uop, unsigned int count)
    1.46 +{
    1.47 +	if (cmd == GNTTABOP_map_grant_ref) {
    1.48 +		unsigned int i;
    1.49 +		for (i = 0; i < count; i++) {
    1.50 +			gnttab_map_grant_ref_pre(
    1.51 +				(struct gnttab_map_grant_ref*)uop + i);
    1.52 +		}
    1.53 +	}
    1.54 +
    1.55 +	return ____HYPERVISOR_grant_table_op(cmd, uop, count);
    1.56 +}
    1.57 +
    1.58 +
    1.59 +///////////////////////////////////////////////////////////////////////////
    1.60  //XXX taken from balloon.c
    1.61  //    temporal hack until balloon driver support.
    1.62  #include <linux/module.h>
     2.1 --- a/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h	Tue May 09 11:40:00 2006 -0600
     2.2 +++ b/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h	Tue May 09 11:41:06 2006 -0600
     2.3 @@ -244,12 +244,19 @@ HYPERVISOR_physdev_op(
     2.4      return rc;
     2.5  }
     2.6  
     2.7 +//XXX __HYPERVISOR_grant_table_op is used for this hypercall constant.
     2.8  static inline int
     2.9 -HYPERVISOR_grant_table_op(
    2.10 +____HYPERVISOR_grant_table_op(
    2.11      unsigned int cmd, void *uop, unsigned int count)
    2.12  {
    2.13      return _hypercall3(int, grant_table_op, cmd, uop, count);
    2.14  }
    2.15 +#ifndef CONFIG_XEN_IA64_DOM0_VP
    2.16 +#define HYPERVISOR_grant_table_op(cmd, uop, count) \
    2.17 +	____HYPERVISOR_grant_table_op((cmd), (uop), (count))
    2.18 +#else
    2.19 +int HYPERVISOR_grant_table_op(unsigned int cmd, void *uop, unsigned int count);
    2.20 +#endif
    2.21  
    2.22  static inline int
    2.23  HYPERVISOR_vcpu_op(