# HG changeset patch # User yamahata@xxxxxxxxxxxxx # Date 1179397370 -32400 # Node ID 14309fd3e3e76056c484d2815c49ff67b12d7d0b # Parent ac28ee0ee0981a49fe7150e7cd43e14802908312 add IA64_DOM0VP_fpswa_revision hypercall for ia64 domain builder memmap suppor/ PATCHNAME: ia64_dom0vp_fpswa_revision_hypercall Signed-off-by: Isaku Yamahata diff -r ac28ee0ee098 -r 14309fd3e3e7 linux-2.6-xen-sparse/arch/ia64/xen/xcom_hcall.c --- a/linux-2.6-xen-sparse/arch/ia64/xen/xcom_hcall.c Wed May 16 11:38:48 2007 -0600 +++ b/linux-2.6-xen-sparse/arch/ia64/xen/xcom_hcall.c Thu May 17 19:22:50 2007 +0900 @@ -395,3 +395,10 @@ xencomm_hypercall_vcpu_op(int cmd, int c return xencomm_arch_hypercall_vcpu_op(cmd, cpu, xencomm_create_inline(arg)); } + +int +xencomm_hypercall_fpswa_revision(unsigned int *revision) +{ + return xencomm_arch_hypercall_fpswa_revision( + xencomm_create_inline(revision)); +} diff -r ac28ee0ee098 -r 14309fd3e3e7 linux-2.6-xen-sparse/arch/ia64/xen/xcom_mini.c --- a/linux-2.6-xen-sparse/arch/ia64/xen/xcom_mini.c Wed May 16 11:38:48 2007 -0600 +++ b/linux-2.6-xen-sparse/arch/ia64/xen/xcom_mini.c Thu May 17 19:22:50 2007 +0900 @@ -467,3 +467,19 @@ xencomm_mini_hypercall_sched_op(int cmd, return xencomm_arch_hypercall_sched_op(cmd, desc); } EXPORT_SYMBOL_GPL(xencomm_mini_hypercall_sched_op); + +int +xencomm_mini_hypercall_fpswa_revision(unsigned int *revision) +{ + int nbr_area = 2; + struct xencomm_mini xc_area[2]; + struct xencomm_handle *desc; + int rc; + + rc = xencomm_create_mini(xc_area, &nbr_area, + revision, sizeof(*revision), &desc); + if (rc) + return rc; + return xencomm_arch_hypercall_fpswa_revision(desc); +} +EXPORT_SYMBOL_GPL(xencomm_mini_hypercall_fpswa_revision); diff -r ac28ee0ee098 -r 14309fd3e3e7 linux-2.6-xen-sparse/arch/ia64/xen/xcom_privcmd.c --- a/linux-2.6-xen-sparse/arch/ia64/xen/xcom_privcmd.c Wed May 16 11:38:48 2007 -0600 +++ b/linux-2.6-xen-sparse/arch/ia64/xen/xcom_privcmd.c Thu May 17 19:22:50 2007 +0900 @@ -643,6 +643,38 @@ xencomm_privcmd_sched_op(privcmd_hyperca return ret; } +static int +xencomm_privcmd_ia64_dom0vp_op(privcmd_hypercall_t *hypercall) +{ + int cmd = hypercall->arg[0]; + int ret; + + switch (cmd) { + case IA64_DOM0VP_fpswa_revision: { + unsigned int revision; + unsigned int __user *revision_user = + (unsigned int* __user)hypercall->arg[1]; + struct xencomm_handle *desc; + ret = xencomm_create(&revision, sizeof(revision), + &desc, GFP_KERNEL); + if (ret) + break; + ret = xencomm_arch_hypercall_fpswa_revision(desc); + xencomm_free(desc); + if (ret) + break; + if (copy_to_user(revision_user, &revision, sizeof(revision))) + ret = -EFAULT; + break; + } + default: + printk("%s: unknown IA64 DOM0VP op %d\n", __func__, cmd); + ret = -EINVAL; + break; + } + return ret; +} + int privcmd_hypercall(privcmd_hypercall_t *hypercall) { @@ -665,6 +697,8 @@ privcmd_hypercall(privcmd_hypercall_t *h return xencomm_privcmd_hvm_op(hypercall); case __HYPERVISOR_sched_op: return xencomm_privcmd_sched_op(hypercall); + case __HYPERVISOR_ia64_dom0vp_op: + return xencomm_privcmd_ia64_dom0vp_op(hypercall); default: printk("%s: unknown hcall (%ld)\n", __func__, hypercall->op); return -ENOSYS; diff -r ac28ee0ee098 -r 14309fd3e3e7 linux-2.6-xen-sparse/include/asm-ia64/hypercall.h --- a/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h Wed May 16 11:38:48 2007 -0600 +++ b/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h Thu May 17 19:22:50 2007 +0900 @@ -380,6 +380,13 @@ xencomm_arch_hypercall_perfmon_op(unsign { return _hypercall4(int, ia64_dom0vp_op, IA64_DOM0VP_perfmon, cmd, arg, count); +} + +static inline int +xencomm_arch_hypercall_fpswa_revision(struct xencomm_handle *arg) +{ + return _hypercall2(int, ia64_dom0vp_op, + IA64_DOM0VP_fpswa_revision, arg); } // for balloon driver @@ -397,6 +404,7 @@ xencomm_arch_hypercall_perfmon_op(unsign #define HYPERVISOR_memory_op xencomm_mini_hypercall_memory_op #define HYPERVISOR_xenoprof_op xencomm_mini_hypercall_xenoprof_op #define HYPERVISOR_perfmon_op xencomm_mini_hypercall_perfmon_op +#define HYPERVISOR_fpswa_revision xencomm_mini_hypercall_fpswa_revision #else #define HYPERVISOR_sched_op xencomm_hypercall_sched_op #define HYPERVISOR_event_channel_op xencomm_hypercall_event_channel_op @@ -408,6 +416,7 @@ xencomm_arch_hypercall_perfmon_op(unsign #define HYPERVISOR_memory_op xencomm_hypercall_memory_op #define HYPERVISOR_xenoprof_op xencomm_hypercall_xenoprof_op #define HYPERVISOR_perfmon_op xencomm_hypercall_perfmon_op +#define HYPERVISOR_fpswa_revision xencomm_hypercall_fpswa_revision #endif #define HYPERVISOR_suspend xencomm_hypercall_suspend diff -r ac28ee0ee098 -r 14309fd3e3e7 xen/arch/ia64/xen/dom0_ops.c --- a/xen/arch/ia64/xen/dom0_ops.c Wed May 16 11:38:48 2007 -0600 +++ b/xen/arch/ia64/xen/dom0_ops.c Thu May 17 19:22:50 2007 +0900 @@ -352,6 +352,16 @@ dom0vp_ioremap(struct domain *d, unsigne ASSIGN_writable | ASSIGN_nocache); } +static unsigned long +dom0vp_fpswa_revision(XEN_GUEST_HANDLE(uint) revision) +{ + if (fpswa_interface == NULL) + return -ENOSYS; + if (copy_to_guest(revision, &fpswa_interface->revision, 1)) + return -EFAULT; + return 0; +} + unsigned long do_dom0vp_op(unsigned long cmd, unsigned long arg0, unsigned long arg1, unsigned long arg2, @@ -400,6 +410,12 @@ do_dom0vp_op(unsigned long cmd, XEN_GUEST_HANDLE(void) hnd; set_xen_guest_handle(hnd, (void*)arg1); ret = do_perfmon_op(arg0, hnd, arg2); + break; + } + case IA64_DOM0VP_fpswa_revision: { + XEN_GUEST_HANDLE(uint) hnd; + set_xen_guest_handle(hnd, (uint*)arg0); + ret = dom0vp_fpswa_revision(hnd); break; } default: diff -r ac28ee0ee098 -r 14309fd3e3e7 xen/include/public/arch-ia64.h --- a/xen/include/public/arch-ia64.h Wed May 16 11:38:48 2007 -0600 +++ b/xen/include/public/arch-ia64.h Thu May 17 19:22:50 2007 +0900 @@ -504,6 +504,9 @@ DEFINE_XEN_GUEST_HANDLE(vcpu_guest_conte /* gmfn version of IA64_DOM0VP_add_physmap */ #define IA64_DOM0VP_add_physmap_with_gmfn 9 +/* get fpswa revision */ +#define IA64_DOM0VP_fpswa_revision 10 + // flags for page assignement to pseudo physical address space #define _ASSIGN_readonly 0 #define ASSIGN_readonly (1UL << _ASSIGN_readonly)