[IA64] add IA64_dom0VP_add_memdesc hypercall.

This hypercall is necessary for pv_ops balloon driver which
uses Linux memory hot plug in order to tell the region
which will be populated.

Signed-off-by: Isaku Yamahata <[EMAIL PROTECTED]>

diff -r e912134782e0 xen/arch/ia64/xen/dom0_ops.c
--- a/xen/arch/ia64/xen/dom0_ops.c      Thu Oct 02 17:56:17 2008 +0900
+++ b/xen/arch/ia64/xen/dom0_ops.c      Thu Oct 02 17:59:42 2008 +0900
@@ -603,6 +603,12 @@
         ret = dom0vp_get_memmap((domid_t)arg0, hnd);
         break;
     }
+    case IA64_DOM0VP_add_memdesc: {
+        XEN_GUEST_HANDLE(char) hnd;
+        set_xen_guest_handle(hnd, (char*)arg1);
+        ret = dom0vp_add_memdesc(d, (domid_t)arg0, hnd);
+        break;
+    }
     default:
         ret = -1;
                printk("unknown dom0_vp_op 0x%lx\n", cmd);
diff -r e912134782e0 xen/arch/ia64/xen/mm.c
--- a/xen/arch/ia64/xen/mm.c    Thu Oct 02 17:56:17 2008 +0900
+++ b/xen/arch/ia64/xen/mm.c    Thu Oct 02 17:59:42 2008 +0900
@@ -2508,6 +2508,31 @@
 
     return ret;
 }
+
+unsigned long
+dom0vp_add_memdesc(struct domain *d,
+                   domid_t targ_domid, XEN_GUEST_HANDLE(char) buffer)
+{
+    unsigned long ret = 0;
+    struct domain *targ_d;
+    struct xen_ia64_memmap_info u_memmap_info;
+    char *u_memmap;
+
+    ret = memmap_info_copy_from_guest(&u_memmap_info, &u_memmap, buffer);
+    if (ret != 0)
+        return ret;
+
+    ret = rcu_lock_target_domain_by_id(targ_domid, &targ_d);
+    if (ret != 0)
+        goto out;
+
+    ret = __dom0vp_add_memdesc(targ_d, &u_memmap_info, u_memmap);
+
+    rcu_unlock_domain(targ_d);
+ out:
+    xfree(u_memmap);
+    return ret;
+}
 #endif
 
 // grant table host mapping
diff -r e912134782e0 xen/include/asm-ia64/mm.h
--- a/xen/include/asm-ia64/mm.h Thu Oct 02 17:56:17 2008 +0900
+++ b/xen/include/asm-ia64/mm.h Thu Oct 02 17:59:42 2008 +0900
@@ -449,6 +449,7 @@
 extern unsigned long dom0vp_expose_foreign_p2m(struct domain* dest_dom, 
unsigned long dest_gpfn, domid_t domid, XEN_GUEST_HANDLE(char) buffer, unsigned 
long flags);
 extern unsigned long dom0vp_unexpose_foreign_p2m(struct domain* dest_dom, 
unsigned long dest_gpfn, domid_t domid);
 extern unsigned long dom0vp_get_memmap(domid_t domid, XEN_GUEST_HANDLE(char) 
buffer);
+unsigned long dom0vp_add_memdesc(struct domain *d, domid_t targ_domid, 
XEN_GUEST_HANDLE(char) buffer);
 #else
 #define expose_p2m_init()       do { } while (0)
 #define dom0vp_expose_p2m(d, conv_start_gpfn, assign_start_gpfn, expose_size, 
granule_pfn)     (-ENOSYS)
@@ -458,6 +459,7 @@
 #define dom0vp_unexpose_foreign_p2m(dest_dom, dest_gpfn, domid)        
(-ENOSYS)
 #define __dom0vp_add_memdesc(d, memmap_info, memdesc)  (-ENOSYS)
 #define dom0vp_get_memmap(domid, buffer)               (-ENOSYS)
+#define dom0vp_add_memdesc(d, targ_domid, buffer)      (-ENOSYS)
 #endif
 
 extern volatile unsigned long *mpt_table;
diff -r e912134782e0 xen/include/public/arch-ia64.h
--- a/xen/include/public/arch-ia64.h    Thu Oct 02 17:56:17 2008 +0900
+++ b/xen/include/public/arch-ia64.h    Thu Oct 02 17:59:42 2008 +0900
@@ -458,6 +458,9 @@
    This hypercall avoids such race. */
 #define IA64_DOM0VP_get_memmap          14
 
+/* Add a new memory descriptor to memmap_info for memory hot plug */
+#define IA64_DOM0VP_add_memdesc         15
+
 // flags for page assignement to pseudo physical address space
 #define _ASSIGN_readonly                0
 #define ASSIGN_readonly                 (1UL << _ASSIGN_readonly)
[IA64] add IA64_dom0VP_add_memdesc hypercall.

This hypercall is necessary for pv_ops balloon driver which
uses Linux memory hot plug in order to tell the region
which will be populated.

Signed-off-by: Isaku Yamahata <[EMAIL PROTECTED]>

diff -r e912134782e0 xen/arch/ia64/xen/dom0_ops.c
--- a/xen/arch/ia64/xen/dom0_ops.c	Thu Oct 02 17:56:17 2008 +0900
+++ b/xen/arch/ia64/xen/dom0_ops.c	Thu Oct 02 17:59:42 2008 +0900
@@ -603,6 +603,12 @@
         ret = dom0vp_get_memmap((domid_t)arg0, hnd);
         break;
     }
+    case IA64_DOM0VP_add_memdesc: {
+        XEN_GUEST_HANDLE(char) hnd;
+        set_xen_guest_handle(hnd, (char*)arg1);
+        ret = dom0vp_add_memdesc(d, (domid_t)arg0, hnd);
+        break;
+    }
     default:
         ret = -1;
 		printk("unknown dom0_vp_op 0x%lx\n", cmd);
diff -r e912134782e0 xen/arch/ia64/xen/mm.c
--- a/xen/arch/ia64/xen/mm.c	Thu Oct 02 17:56:17 2008 +0900
+++ b/xen/arch/ia64/xen/mm.c	Thu Oct 02 17:59:42 2008 +0900
@@ -2508,6 +2508,31 @@
 
     return ret;
 }
+
+unsigned long
+dom0vp_add_memdesc(struct domain *d,
+                   domid_t targ_domid, XEN_GUEST_HANDLE(char) buffer)
+{
+    unsigned long ret = 0;
+    struct domain *targ_d;
+    struct xen_ia64_memmap_info u_memmap_info;
+    char *u_memmap;
+
+    ret = memmap_info_copy_from_guest(&u_memmap_info, &u_memmap, buffer);
+    if (ret != 0)
+        return ret;
+
+    ret = rcu_lock_target_domain_by_id(targ_domid, &targ_d);
+    if (ret != 0)
+        goto out;
+
+    ret = __dom0vp_add_memdesc(targ_d, &u_memmap_info, u_memmap);
+
+    rcu_unlock_domain(targ_d);
+ out:
+    xfree(u_memmap);
+    return ret;
+}
 #endif
 
 // grant table host mapping
diff -r e912134782e0 xen/include/asm-ia64/mm.h
--- a/xen/include/asm-ia64/mm.h	Thu Oct 02 17:56:17 2008 +0900
+++ b/xen/include/asm-ia64/mm.h	Thu Oct 02 17:59:42 2008 +0900
@@ -449,6 +449,7 @@
 extern unsigned long dom0vp_expose_foreign_p2m(struct domain* dest_dom, unsigned long dest_gpfn, domid_t domid, XEN_GUEST_HANDLE(char) buffer, unsigned long flags);
 extern unsigned long dom0vp_unexpose_foreign_p2m(struct domain* dest_dom, unsigned long dest_gpfn, domid_t domid);
 extern unsigned long dom0vp_get_memmap(domid_t domid, XEN_GUEST_HANDLE(char) buffer);
+unsigned long dom0vp_add_memdesc(struct domain *d, domid_t targ_domid, XEN_GUEST_HANDLE(char) buffer);
 #else
 #define expose_p2m_init()       do { } while (0)
 #define dom0vp_expose_p2m(d, conv_start_gpfn, assign_start_gpfn, expose_size, granule_pfn)	(-ENOSYS)
@@ -458,6 +459,7 @@
 #define dom0vp_unexpose_foreign_p2m(dest_dom, dest_gpfn, domid)	(-ENOSYS)
 #define __dom0vp_add_memdesc(d, memmap_info, memdesc)	(-ENOSYS)
 #define dom0vp_get_memmap(domid, buffer)		(-ENOSYS)
+#define dom0vp_add_memdesc(d, targ_domid, buffer)	(-ENOSYS)
 #endif
 
 extern volatile unsigned long *mpt_table;
diff -r e912134782e0 xen/include/public/arch-ia64.h
--- a/xen/include/public/arch-ia64.h	Thu Oct 02 17:56:17 2008 +0900
+++ b/xen/include/public/arch-ia64.h	Thu Oct 02 17:59:42 2008 +0900
@@ -458,6 +458,9 @@
    This hypercall avoids such race. */
 #define IA64_DOM0VP_get_memmap          14
 
+/* Add a new memory descriptor to memmap_info for memory hot plug */
+#define IA64_DOM0VP_add_memdesc         15
+
 // flags for page assignement to pseudo physical address space
 #define _ASSIGN_readonly                0
 #define ASSIGN_readonly                 (1UL << _ASSIGN_readonly)
_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@lists.xensource.com
http://lists.xensource.com/xen-ia64-devel

Reply via email to