direct-io.hg

changeset 15294:caafa45d24b3

[IA64] memmap: add IA64_DOM0VP_fpswa_revision hypercall

For ia64 domain builder memmap support

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Alex Williamson <alex.williamson@hp.com>
date Mon May 21 10:09:33 2007 -0600 (2007-05-21)
parents bf6f94206fec
children c2768258711d
files linux-2.6-xen-sparse/arch/ia64/xen/xcom_hcall.c linux-2.6-xen-sparse/arch/ia64/xen/xcom_mini.c linux-2.6-xen-sparse/arch/ia64/xen/xcom_privcmd.c linux-2.6-xen-sparse/include/asm-ia64/hypercall.h xen/arch/ia64/xen/dom0_ops.c xen/include/public/arch-ia64.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/ia64/xen/xcom_hcall.c	Sun May 20 21:28:48 2007 -0600
     1.2 +++ b/linux-2.6-xen-sparse/arch/ia64/xen/xcom_hcall.c	Mon May 21 10:09:33 2007 -0600
     1.3 @@ -395,3 +395,10 @@ xencomm_hypercall_vcpu_op(int cmd, int c
     1.4  	return xencomm_arch_hypercall_vcpu_op(cmd, cpu,
     1.5  					      xencomm_create_inline(arg));
     1.6  }
     1.7 +
     1.8 +int
     1.9 +xencomm_hypercall_fpswa_revision(unsigned int *revision)
    1.10 +{
    1.11 +	return xencomm_arch_hypercall_fpswa_revision(
    1.12 +		xencomm_create_inline(revision));
    1.13 +}
     2.1 --- a/linux-2.6-xen-sparse/arch/ia64/xen/xcom_mini.c	Sun May 20 21:28:48 2007 -0600
     2.2 +++ b/linux-2.6-xen-sparse/arch/ia64/xen/xcom_mini.c	Mon May 21 10:09:33 2007 -0600
     2.3 @@ -467,3 +467,19 @@ xencomm_mini_hypercall_sched_op(int cmd,
     2.4  	return xencomm_arch_hypercall_sched_op(cmd, desc);
     2.5  }
     2.6  EXPORT_SYMBOL_GPL(xencomm_mini_hypercall_sched_op);
     2.7 +
     2.8 +int
     2.9 +xencomm_mini_hypercall_fpswa_revision(unsigned int *revision)
    2.10 +{
    2.11 +	int nbr_area = 2;
    2.12 +	struct xencomm_mini xc_area[2];
    2.13 +	struct xencomm_handle *desc;
    2.14 +	int rc;
    2.15 +
    2.16 +	rc = xencomm_create_mini(xc_area, &nbr_area,
    2.17 +				 revision, sizeof(*revision), &desc);
    2.18 +	if (rc)
    2.19 +		return rc;
    2.20 +	return xencomm_arch_hypercall_fpswa_revision(desc);
    2.21 +}
    2.22 +EXPORT_SYMBOL_GPL(xencomm_mini_hypercall_fpswa_revision);
     3.1 --- a/linux-2.6-xen-sparse/arch/ia64/xen/xcom_privcmd.c	Sun May 20 21:28:48 2007 -0600
     3.2 +++ b/linux-2.6-xen-sparse/arch/ia64/xen/xcom_privcmd.c	Mon May 21 10:09:33 2007 -0600
     3.3 @@ -643,6 +643,38 @@ xencomm_privcmd_sched_op(privcmd_hyperca
     3.4  	return ret;
     3.5  }
     3.6  
     3.7 +static int
     3.8 +xencomm_privcmd_ia64_dom0vp_op(privcmd_hypercall_t *hypercall)
     3.9 +{
    3.10 +	int cmd = hypercall->arg[0];
    3.11 +	int ret;
    3.12 +	
    3.13 +	switch (cmd) {
    3.14 +	case IA64_DOM0VP_fpswa_revision: {
    3.15 +		unsigned int revision;
    3.16 +		unsigned int __user *revision_user =
    3.17 +			(unsigned int* __user)hypercall->arg[1];
    3.18 +		struct xencomm_handle *desc;
    3.19 +		ret = xencomm_create(&revision, sizeof(revision),
    3.20 +				     &desc, GFP_KERNEL);
    3.21 +		if (ret)
    3.22 +			break;
    3.23 +		ret = xencomm_arch_hypercall_fpswa_revision(desc);
    3.24 +		xencomm_free(desc);
    3.25 +		if (ret)
    3.26 +			break;
    3.27 +		if (copy_to_user(revision_user, &revision, sizeof(revision)))
    3.28 +			ret = -EFAULT;
    3.29 +		break;
    3.30 +	}
    3.31 +	default:
    3.32 +		printk("%s: unknown IA64 DOM0VP op %d\n", __func__, cmd);
    3.33 +		ret = -EINVAL;
    3.34 +		break;
    3.35 +	}
    3.36 +	return ret;
    3.37 +}
    3.38 +
    3.39  int
    3.40  privcmd_hypercall(privcmd_hypercall_t *hypercall)
    3.41  {
    3.42 @@ -665,6 +697,8 @@ privcmd_hypercall(privcmd_hypercall_t *h
    3.43  		return xencomm_privcmd_hvm_op(hypercall);
    3.44  	case __HYPERVISOR_sched_op:
    3.45  		return xencomm_privcmd_sched_op(hypercall);
    3.46 +	case __HYPERVISOR_ia64_dom0vp_op:
    3.47 +		return xencomm_privcmd_ia64_dom0vp_op(hypercall);
    3.48  	default:
    3.49  		printk("%s: unknown hcall (%ld)\n", __func__, hypercall->op);
    3.50  		return -ENOSYS;
     4.1 --- a/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h	Sun May 20 21:28:48 2007 -0600
     4.2 +++ b/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h	Mon May 21 10:09:33 2007 -0600
     4.3 @@ -382,6 +382,13 @@ xencomm_arch_hypercall_perfmon_op(unsign
     4.4  			   IA64_DOM0VP_perfmon, cmd, arg, count);
     4.5  }
     4.6  
     4.7 +static inline int
     4.8 +xencomm_arch_hypercall_fpswa_revision(struct xencomm_handle *arg)
     4.9 +{
    4.10 +	return _hypercall2(int, ia64_dom0vp_op,
    4.11 +			   IA64_DOM0VP_fpswa_revision, arg);
    4.12 +}
    4.13 +
    4.14  // for balloon driver
    4.15  #define HYPERVISOR_update_va_mapping(va, new_val, flags) (0)
    4.16  
    4.17 @@ -397,6 +404,7 @@ xencomm_arch_hypercall_perfmon_op(unsign
    4.18  #define HYPERVISOR_memory_op xencomm_mini_hypercall_memory_op
    4.19  #define HYPERVISOR_xenoprof_op xencomm_mini_hypercall_xenoprof_op
    4.20  #define HYPERVISOR_perfmon_op xencomm_mini_hypercall_perfmon_op
    4.21 +#define HYPERVISOR_fpswa_revision xencomm_mini_hypercall_fpswa_revision
    4.22  #else
    4.23  #define HYPERVISOR_sched_op xencomm_hypercall_sched_op
    4.24  #define HYPERVISOR_event_channel_op xencomm_hypercall_event_channel_op
    4.25 @@ -408,6 +416,7 @@ xencomm_arch_hypercall_perfmon_op(unsign
    4.26  #define HYPERVISOR_memory_op xencomm_hypercall_memory_op
    4.27  #define HYPERVISOR_xenoprof_op xencomm_hypercall_xenoprof_op
    4.28  #define HYPERVISOR_perfmon_op xencomm_hypercall_perfmon_op
    4.29 +#define HYPERVISOR_fpswa_revision xencomm_hypercall_fpswa_revision
    4.30  #endif
    4.31  
    4.32  #define HYPERVISOR_suspend xencomm_hypercall_suspend
     5.1 --- a/xen/arch/ia64/xen/dom0_ops.c	Sun May 20 21:28:48 2007 -0600
     5.2 +++ b/xen/arch/ia64/xen/dom0_ops.c	Mon May 21 10:09:33 2007 -0600
     5.3 @@ -352,6 +352,16 @@ dom0vp_ioremap(struct domain *d, unsigne
     5.4                                     ASSIGN_writable | ASSIGN_nocache);
     5.5  }
     5.6  
     5.7 +static unsigned long
     5.8 +dom0vp_fpswa_revision(XEN_GUEST_HANDLE(uint) revision)
     5.9 +{
    5.10 +    if (fpswa_interface == NULL)
    5.11 +        return -ENOSYS;
    5.12 +    if (copy_to_guest(revision, &fpswa_interface->revision, 1))
    5.13 +        return -EFAULT;
    5.14 +    return 0;
    5.15 +}
    5.16 +
    5.17  unsigned long
    5.18  do_dom0vp_op(unsigned long cmd,
    5.19               unsigned long arg0, unsigned long arg1, unsigned long arg2,
    5.20 @@ -402,6 +412,12 @@ do_dom0vp_op(unsigned long cmd,
    5.21          ret = do_perfmon_op(arg0, hnd, arg2);
    5.22          break;
    5.23      }
    5.24 +    case IA64_DOM0VP_fpswa_revision: {
    5.25 +        XEN_GUEST_HANDLE(uint) hnd;
    5.26 +        set_xen_guest_handle(hnd, (uint*)arg0);
    5.27 +        ret = dom0vp_fpswa_revision(hnd);
    5.28 +        break;
    5.29 +    }
    5.30      default:
    5.31          ret = -1;
    5.32  		printk("unknown dom0_vp_op 0x%lx\n", cmd);
     6.1 --- a/xen/include/public/arch-ia64.h	Sun May 20 21:28:48 2007 -0600
     6.2 +++ b/xen/include/public/arch-ia64.h	Mon May 21 10:09:33 2007 -0600
     6.3 @@ -504,6 +504,9 @@ DEFINE_XEN_GUEST_HANDLE(vcpu_guest_conte
     6.4  /* gmfn version of IA64_DOM0VP_add_physmap */
     6.5  #define IA64_DOM0VP_add_physmap_with_gmfn       9
     6.6  
     6.7 +/* get fpswa revision */
     6.8 +#define IA64_DOM0VP_fpswa_revision      10
     6.9 +
    6.10  // flags for page assignement to pseudo physical address space
    6.11  #define _ASSIGN_readonly                0
    6.12  #define ASSIGN_readonly                 (1UL << _ASSIGN_readonly)