[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [IA64] memmap: add IA64_DOM0VP_fpswa_revision hypercall



# HG changeset patch
# User Alex Williamson <alex.williamson@xxxxxx>
# Date 1179763773 21600
# Node ID caafa45d24b3cbf05ab97ab33235e5b91ac44323
# Parent  bf6f94206fec9a247eed02dc3a031fc9129883bb
[IA64] memmap: add IA64_DOM0VP_fpswa_revision hypercall

For ia64 domain builder memmap support

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
---
 linux-2.6-xen-sparse/arch/ia64/xen/xcom_hcall.c   |    7 ++++
 linux-2.6-xen-sparse/arch/ia64/xen/xcom_mini.c    |   16 ++++++++++
 linux-2.6-xen-sparse/arch/ia64/xen/xcom_privcmd.c |   34 ++++++++++++++++++++++
 linux-2.6-xen-sparse/include/asm-ia64/hypercall.h |    9 +++++
 xen/arch/ia64/xen/dom0_ops.c                      |   16 ++++++++++
 xen/include/public/arch-ia64.h                    |    3 +
 6 files changed, 85 insertions(+)

diff -r bf6f94206fec -r caafa45d24b3 
linux-2.6-xen-sparse/arch/ia64/xen/xcom_hcall.c
--- a/linux-2.6-xen-sparse/arch/ia64/xen/xcom_hcall.c   Sun May 20 21:28:48 
2007 -0600
+++ b/linux-2.6-xen-sparse/arch/ia64/xen/xcom_hcall.c   Mon May 21 10:09:33 
2007 -0600
@@ -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 bf6f94206fec -r caafa45d24b3 
linux-2.6-xen-sparse/arch/ia64/xen/xcom_mini.c
--- a/linux-2.6-xen-sparse/arch/ia64/xen/xcom_mini.c    Sun May 20 21:28:48 
2007 -0600
+++ b/linux-2.6-xen-sparse/arch/ia64/xen/xcom_mini.c    Mon May 21 10:09:33 
2007 -0600
@@ -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 bf6f94206fec -r caafa45d24b3 
linux-2.6-xen-sparse/arch/ia64/xen/xcom_privcmd.c
--- a/linux-2.6-xen-sparse/arch/ia64/xen/xcom_privcmd.c Sun May 20 21:28:48 
2007 -0600
+++ b/linux-2.6-xen-sparse/arch/ia64/xen/xcom_privcmd.c Mon May 21 10:09:33 
2007 -0600
@@ -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 bf6f94206fec -r caafa45d24b3 
linux-2.6-xen-sparse/include/asm-ia64/hypercall.h
--- a/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h Sun May 20 21:28:48 
2007 -0600
+++ b/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h Mon May 21 10:09:33 
2007 -0600
@@ -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 bf6f94206fec -r caafa45d24b3 xen/arch/ia64/xen/dom0_ops.c
--- a/xen/arch/ia64/xen/dom0_ops.c      Sun May 20 21:28:48 2007 -0600
+++ b/xen/arch/ia64/xen/dom0_ops.c      Mon May 21 10:09:33 2007 -0600
@@ -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 bf6f94206fec -r caafa45d24b3 xen/include/public/arch-ia64.h
--- a/xen/include/public/arch-ia64.h    Sun May 20 21:28:48 2007 -0600
+++ b/xen/include/public/arch-ia64.h    Mon May 21 10:09:33 2007 -0600
@@ -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)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.