ia64/linux-2.6.18-xen.hg

changeset 911:92a119f247f7

[IA64] xencomm: tmem support.

add tmem support to xencomm.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Isaku Yamahata <yamahata@valinux.co.jp>
date Mon Jun 29 11:23:16 2009 +0900 (2009-06-29)
parents 5bb4e5dd1abc
children dd42cdb0ab89
files arch/ia64/xen/xcom_hcall.c arch/ia64/xen/xcom_privcmd.c include/asm-ia64/hypercall.h
line diff
     1.1 --- a/arch/ia64/xen/xcom_hcall.c	Mon Jun 29 11:22:41 2009 +0900
     1.2 +++ b/arch/ia64/xen/xcom_hcall.c	Mon Jun 29 11:23:16 2009 +0900
     1.3 @@ -40,6 +40,7 @@
     1.4  #include <xen/interface/xenoprof.h>
     1.5  #include <xen/interface/vcpu.h>
     1.6  #include <xen/interface/kexec.h>
     1.7 +#include <xen/interface/tmem.h>
     1.8  #include <asm/hypervisor.h>
     1.9  #include <asm/page.h>
    1.10  #include <asm/uaccess.h>
    1.11 @@ -739,3 +740,15 @@ xencomm_hypercall_kexec_op(int cmd, void
    1.12  
    1.13  	return xencomm_arch_hypercall_kexec_op(cmd, desc);
    1.14  }
    1.15 +
    1.16 +int
    1.17 +xencomm_hypercall_tmem_op(struct tmem_op *op)
    1.18 +{
    1.19 +	struct xencomm_handle *desc;
    1.20 +
    1.21 +	desc = xencomm_map_no_alloc(op, sizeof(*op));
    1.22 +	if (desc == NULL)
    1.23 +		return -EINVAL;
    1.24 +
    1.25 +	return xencomm_arch_hypercall_tmem_op(desc);
    1.26 +}
     2.1 --- a/arch/ia64/xen/xcom_privcmd.c	Mon Jun 29 11:22:41 2009 +0900
     2.2 +++ b/arch/ia64/xen/xcom_privcmd.c	Mon Jun 29 11:23:16 2009 +0900
     2.3 @@ -32,6 +32,7 @@
     2.4  #include <xen/interface/xsm/acm_ops.h>
     2.5  #include <xen/interface/hvm/params.h>
     2.6  #include <xen/interface/arch-ia64/debug_op.h>
     2.7 +#include <xen/interface/tmem.h>
     2.8  #include <xen/public/privcmd.h>
     2.9  #include <asm/hypercall.h>
    2.10  #include <asm/page.h>
    2.11 @@ -897,6 +898,22 @@ xencomm_privcmd_ia64_physdev_op(privcmd_
    2.12  	return ret;
    2.13  }
    2.14  
    2.15 +static int
    2.16 +xencomm_privcmd_tmem_op(privcmd_hypercall_t *hypercall)
    2.17 +{
    2.18 +	struct xencomm_handle *desc;
    2.19 +	int ret;
    2.20 +
    2.21 +	desc = xencomm_map((void *)hypercall->arg[0], sizeof(struct tmem_op));
    2.22 +	if (desc == NULL)
    2.23 +		return -ENOMEM;
    2.24 +
    2.25 +	ret = xencomm_arch_hypercall_tmem_op(desc);
    2.26 +
    2.27 +	xencomm_free(desc);
    2.28 +	return ret;
    2.29 +}
    2.30 +
    2.31  int
    2.32  privcmd_hypercall(privcmd_hypercall_t *hypercall)
    2.33  {
    2.34 @@ -925,6 +942,8 @@ privcmd_hypercall(privcmd_hypercall_t *h
    2.35  		return xencomm_privcmd_ia64_debug_op(hypercall);
    2.36  	case __HYPERVISOR_physdev_op:
    2.37  		return xencomm_privcmd_ia64_physdev_op(hypercall);
    2.38 +	case __HYPERVISOR_tmem_op:
    2.39 +		return xencomm_privcmd_tmem_op(hypercall);
    2.40  	default:
    2.41  		printk("%s: unknown hcall (%ld)\n", __func__, hypercall->op);
    2.42  		return -ENOSYS;
     3.1 --- a/include/asm-ia64/hypercall.h	Mon Jun 29 11:22:41 2009 +0900
     3.2 +++ b/include/asm-ia64/hypercall.h	Mon Jun 29 11:23:16 2009 +0900
     3.3 @@ -435,6 +435,12 @@ xencomm_arch_hypercall_kexec_op(int cmd,
     3.4  	return _hypercall2(int, kexec_op, cmd, arg);
     3.5  }
     3.6  
     3.7 +static inline int
     3.8 +xencomm_arch_hypercall_tmem_op(struct xencomm_handle *arg)
     3.9 +{
    3.10 +	return _hypercall1(int, tmem_op, arg);
    3.11 +}
    3.12 +
    3.13  // for balloon driver
    3.14  #define HYPERVISOR_update_va_mapping(va, new_val, flags) (0)
    3.15  
    3.16 @@ -455,6 +461,7 @@ xencomm_arch_hypercall_kexec_op(int cmd,
    3.17  #define HYPERVISOR_vcpu_op xencomm_hypercall_vcpu_op
    3.18  #define HYPERVISOR_opt_feature xencomm_hypercall_opt_feature
    3.19  #define HYPERVISOR_kexec_op xencomm_hypercall_kexec_op
    3.20 +#define HYPERVISOR_tmem_op xencomm_hypercall_tmem_op
    3.21  
    3.22  /* to compile gnttab_copy_grant_page() in drivers/xen/core/gnttab.c */
    3.23  #define HYPERVISOR_mmu_update(req, count, success_count, domid) ({BUG();0;})