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-changelog

[Xen-changelog] [xen-unstable] Ensure page-table pin changes are noted i

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Ensure page-table pin changes are noted in shadow log-dirty mode.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 20 Sep 2006 16:40:14 +0000
Delivery-date: Wed, 20 Sep 2006 09:42:11 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Steven Hand <steven@xxxxxxxxxxxxx>
# Node ID a151311fa9c79c61b20797246690fb16a3a26651
# Parent  9837ff37e35499a2758050fdb40a732942d180ac
Ensure page-table pin changes are noted in shadow log-dirty mode.
Also mark dirty in put_page_type() instead of free_page_type()

Signed-off-by: Steven Hand <steven@xxxxxxxxxxxxx>
---
 xen/arch/x86/mm.c |   28 ++++++++++++++++++----------
 1 files changed, 18 insertions(+), 10 deletions(-)

diff -r 9837ff37e354 -r a151311fa9c7 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c Wed Sep 20 12:02:13 2006 +0100
+++ b/xen/arch/x86/mm.c Wed Sep 20 16:22:06 2006 +0100
@@ -1536,10 +1536,6 @@ void free_page_type(struct page_info *pa
         if ( unlikely(shadow_mode_enabled(owner)
                  && !shadow_lock_is_acquired(owner)) )
         {
-            /* Raw page tables are rewritten during save/restore. */
-            if ( !shadow_mode_translate(owner) )
-                mark_dirty(owner, page_to_mfn(page));
-
             if ( shadow_mode_refcounts(owner) )
                 return;
 
@@ -1584,6 +1580,7 @@ void put_page_type(struct page_info *pag
 void put_page_type(struct page_info *page)
 {
     unsigned long nx, x, y = page->u.inuse.type_info;
+    struct domain *owner = page_get_owner(page);
 
  again:
     do {
@@ -1617,6 +1614,18 @@ void put_page_type(struct page_info *pag
         }
     }
     while ( unlikely((y = cmpxchg(&page->u.inuse.type_info, x, nx)) != x) );
+
+    if( likely(owner != NULL) )
+    {
+        if (shadow_mode_enabled(owner))
+        {
+            if (shadow_lock_is_acquired(owner))  /* this is a shadow page */
+                return;
+
+            if (!shadow_mode_translate(owner))
+                mark_dirty(owner, page_to_mfn(page));
+        }
+    }
 }
 
 
@@ -1975,7 +1984,10 @@ int do_mmuext_op(
                 okay = 0;
                 break;
             }
-            
+
+            if ( shadow_mode_enabled(d) )
+                mark_dirty(d, mfn);
+           
             break;
 
         case MMUEXT_UNPIN_TABLE:
@@ -1993,11 +2005,7 @@ int do_mmuext_op(
                 put_page_and_type(page);
                 put_page(page);
                 if ( shadow_mode_enabled(d) )
-                {
-                    shadow_lock(d);
-                    shadow_remove_all_shadows(v, _mfn(mfn));
-                    shadow_unlock(d);
-                }
+                    mark_dirty(d, mfn);
             }
             else
             {

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Ensure page-table pin changes are noted in shadow log-dirty mode., Xen patchbot-unstable <=