WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ia64-devel

[Xen-ia64-devel] [PATCH 7/7] introduce add_memdesc hypercall.

To: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-ia64-devel] [PATCH 7/7] introduce add_memdesc hypercall.
From: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Date: Thu, 2 Oct 2008 18:08:04 +0900
Cc: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Delivery-date: Thu, 02 Oct 2008 02:04:22 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.18 (2008-05-17)
[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 <yamahata@xxxxxxxxxxxxx>

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)

Attachment: memmap-info-hypercall.patch
Description: Text Data

_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-ia64-devel] [PATCH 7/7] introduce add_memdesc hypercall., Isaku Yamahata <=