# HG changeset patch # User yamahata@xxxxxxxxxxxxx # Node ID d47e2b8921557d93cb22d5cd1d063cafdde2ebc0 # Parent ea0ac59b807f9fadd072b1f4f625eb3739da9635 Current xen/ia64 grant table ignores some GNTMAP_xxx flags. work around for that. This patch will be removed once the flags are supported. PATCHNAME: grant_table_hypercall_work_around Signed-off-by: Isaku Yamahata diff -r ea0ac59b807f -r d47e2b892155 linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c --- a/linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c Mon May 8 11:42:35 2006 +0900 +++ b/linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c Mon May 8 11:42:37 2006 +0900 @@ -201,6 +201,59 @@ out: /////////////////////////////////////////////////////////////////////////// +// grant table hack +// cmd: GNTTABOP_xxx + +#include +#include +#include + +static void +gnttab_map_grant_ref_pre(struct gnttab_map_grant_ref *uop) +{ + uint32_t flags; + + flags = uop->flags; + if (flags & GNTMAP_readonly) { +#if 0 + xprintd("GNTMAP_readonly is not supported yet\n"); +#endif + flags &= ~GNTMAP_readonly; + } + + if (flags & GNTMAP_host_map) { + if (flags & GNTMAP_application_map) { + xprintd("GNTMAP_application_map is not supported yet: flags 0x%x\n", flags); + BUG(); + } + if (flags & GNTMAP_contains_pte) { + xprintd("GNTMAP_contains_pte is not supported yet flags 0x%x\n", flags); + BUG(); + } + } else if (flags & GNTMAP_device_map) { + xprintd("GNTMAP_device_map is not supported yet 0x%x\n", flags); + BUG();//XXX not yet. actually this flag is not used. + } else { + BUG(); + } +} + +int +HYPERVISOR_grant_table_op(unsigned int cmd, void *uop, unsigned int count) +{ + if (cmd == GNTTABOP_map_grant_ref) { + unsigned int i; + for (i = 0; i < count; i++) { + gnttab_map_grant_ref_pre( + (struct gnttab_map_grant_ref*)uop + i); + } + } + + return ____HYPERVISOR_grant_table_op(cmd, uop, count); +} + + +/////////////////////////////////////////////////////////////////////////// //XXX taken from balloon.c // temporal hack until balloon driver support. #include diff -r ea0ac59b807f -r d47e2b892155 linux-2.6-xen-sparse/include/asm-ia64/hypercall.h --- a/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h Mon May 8 11:42:35 2006 +0900 +++ b/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h Mon May 8 11:42:37 2006 +0900 @@ -228,12 +228,19 @@ HYPERVISOR_physdev_op( return _hypercall1(int, physdev_op, physdev_op); } -static inline int -HYPERVISOR_grant_table_op( +//XXX __HYPERVISOR_grant_table_op is used for this hypercall constant. +static inline int +____HYPERVISOR_grant_table_op( unsigned int cmd, void *uop, unsigned int count) { return _hypercall3(int, grant_table_op, cmd, uop, count); } +#ifndef CONFIG_XEN_IA64_DOM0_VP +#define HYPERVISOR_grant_table_op(cmd, uop, count) \ + ____HYPERVISOR_grant_table_op((cmd), (uop), (count)) +#else +int HYPERVISOR_grant_table_op(unsigned int cmd, void *uop, unsigned int count); +#endif static inline int HYPERVISOR_vcpu_op(