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

[Xen-ia64-devel] [PATCH] fix XENMEM_add_to_physmap with XENMAPSPACE_mfn



[IA64] fix XENMEM_add_to_physmap with XENMAPSPACE_mfn

In case of XENMEM_add_to_physmap with XENMAPSPACE_mfn,
ASSIGN_allocated shouldn't be specified.
So use assign_domain_page_replace() instead of guest_physmap_add_page().

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>

diff -r 443544c63fb7 xen/arch/ia64/xen/mm.c
--- a/xen/arch/ia64/xen/mm.c    Tue Sep 09 21:10:19 2008 +0900
+++ b/xen/arch/ia64/xen/mm.c    Tue Sep 09 21:11:46 2008 +0900
@@ -2888,13 +2888,19 @@
                 guest_remove_page(d, xatp.gpfn);
         }
 
-        /* Unmap from old location, if any. */
-        gpfn = get_gpfn_from_mfn(mfn);
-        if (gpfn != INVALID_M2P_ENTRY)
-            guest_physmap_remove_page(d, gpfn, mfn, 0);
+        if (xatp.space == XENMAPSPACE_mfn) {
+            assign_domain_page_replace(d, xatp.gpfn << PAGE_SHIFT, mfn,
+                                       ASSIGN_writable);
+            page = NULL; /* prevent put_page() */
+        } else {
+            /* Unmap from old location, if any. */
+            gpfn = get_gpfn_from_mfn(mfn);
+            if (gpfn != INVALID_M2P_ENTRY)
+                guest_physmap_remove_page(d, gpfn, mfn, 0);
 
-        /* Map at new location. */
-        guest_physmap_add_page(d, xatp.gpfn, mfn, 0);
+            /* Map at new location. */
+            guest_physmap_add_page(d, xatp.gpfn, mfn, 0);
+        }
 
     out:
         domain_unlock(d);


-- 
yamahata

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


 


Rackspace

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