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] fix XENMEM_add_to_physmap with XENMAPSPACE_mfn

To: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-ia64-devel] [PATCH] fix XENMEM_add_to_physmap with XENMAPSPACE_mfn
From: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Date: Tue, 9 Sep 2008 21:09:19 +0900
Delivery-date: Tue, 09 Sep 2008 05:09:21 -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.6i
[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

<Prev in Thread] Current Thread [Next in Thread>