# HG changeset patch # User yamahata@xxxxxxxxxxxxx # Date 1176113370 -32400 # Node ID e9b79736d0820113ec1293338fa959be7ec30c58 # Parent b0361ee7a0fb3f97ebf67e8c38ef6ea71c977f5c add IA64_DOM0VP_fpswa_revision hypercall for ia64 new domain builder PATCHNAME: ia64_dom0vp_fpswa_revision_hypercall Signed-off-by: Isaku Yamahata diff -r b0361ee7a0fb -r e9b79736d082 linux-2.6-xen-sparse/arch/ia64/xen/xcom_hcall.c --- a/linux-2.6-xen-sparse/arch/ia64/xen/xcom_hcall.c Fri Apr 06 19:18:16 2007 +0900 +++ b/linux-2.6-xen-sparse/arch/ia64/xen/xcom_hcall.c Mon Apr 09 19:09:30 2007 +0900 @@ -381,3 +381,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 b0361ee7a0fb -r e9b79736d082 linux-2.6-xen-sparse/arch/ia64/xen/xcom_mini.c --- a/linux-2.6-xen-sparse/arch/ia64/xen/xcom_mini.c Fri Apr 06 19:18:16 2007 +0900 +++ b/linux-2.6-xen-sparse/arch/ia64/xen/xcom_mini.c Mon Apr 09 19:09:30 2007 +0900 @@ -418,3 +418,19 @@ xencomm_mini_hypercall_perfmon_op(unsign return xencomm_arch_hypercall_perfmon_op(cmd, desc, count); } EXPORT_SYMBOL_GPL(xencomm_mini_hypercall_perfmon_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 b0361ee7a0fb -r e9b79736d082 linux-2.6-xen-sparse/arch/ia64/xen/xcom_privcmd.c --- a/linux-2.6-xen-sparse/arch/ia64/xen/xcom_privcmd.c Fri Apr 06 19:18:16 2007 +0900 +++ b/linux-2.6-xen-sparse/arch/ia64/xen/xcom_privcmd.c Mon Apr 09 19:09:30 2007 +0900 @@ -634,6 +634,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) { @@ -656,6 +688,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 b0361ee7a0fb -r e9b79736d082 linux-2.6-xen-sparse/include/asm-ia64/hypercall.h --- a/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h Fri Apr 06 19:18:16 2007 +0900 +++ b/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h Mon Apr 09 19:09:30 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 b0361ee7a0fb -r e9b79736d082 xen/arch/ia64/xen/dom0_ops.c --- a/xen/arch/ia64/xen/dom0_ops.c Fri Apr 06 19:18:16 2007 +0900 +++ b/xen/arch/ia64/xen/dom0_ops.c Mon Apr 09 19:09:30 2007 +0900 @@ -353,6 +353,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, @@ -401,6 +411,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 b0361ee7a0fb -r e9b79736d082 xen/include/public/arch-ia64.h --- a/xen/include/public/arch-ia64.h Fri Apr 06 19:18:16 2007 +0900 +++ b/xen/include/public/arch-ia64.h Mon Apr 09 19:09:30 2007 +0900 @@ -406,6 +406,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)