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

[Xen-changelog] [xen-unstable] [XEN] When removing pages, drop shadow refs before complaining about refcount.



# HG changeset patch
# User Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>
# Date 1170931493 0
# Node ID 3fbe12560ffe84359e2bc7bce12b0cc34a1e398c
# Parent  6524e02edbeb8aebe65aa5400af4b09dfccb8729
[XEN] When removing pages, drop shadow refs before complaining about refcount.
Signed-off-by: Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>
---
 xen/common/memory.c          |   10 ++++++----
 xen/include/asm-x86/shadow.h |    5 +++--
 2 files changed, 9 insertions(+), 6 deletions(-)

diff -r 6524e02edbeb -r 3fbe12560ffe xen/common/memory.c
--- a/xen/common/memory.c       Wed Feb 07 16:53:01 2007 -0800
+++ b/xen/common/memory.c       Thu Feb 08 10:44:53 2007 +0000
@@ -175,11 +175,13 @@ int guest_remove_page(struct domain *d, 
 
     if ( unlikely(!page_is_removable(page)) )
     {
+        shadow_drop_references(d, page);
         /* We'll make this a guest-visible error in future, so take heed! */
-        gdprintk(XENLOG_INFO, "Dom%d freeing in-use page %lx (pseudophys %lx):"
-                " count=%lx type=%lx\n",
-                d->domain_id, mfn, get_gpfn_from_mfn(mfn),
-                (unsigned long)page->count_info, page->u.inuse.type_info);
+        if ( !page_is_removable(page) )
+            gdprintk(XENLOG_INFO, "Dom%d freeing in-use page %lx "
+                     "(pseudophys %lx): count=%lx type=%lx\n",
+                     d->domain_id, mfn, get_gpfn_from_mfn(mfn),
+                     (unsigned long)page->count_info, page->u.inuse.type_info);
     }
 
     guest_physmap_remove_page(d, gmfn, mfn);
diff -r 6524e02edbeb -r 3fbe12560ffe xen/include/asm-x86/shadow.h
--- a/xen/include/asm-x86/shadow.h      Wed Feb 07 16:53:01 2007 -0800
+++ b/xen/include/asm-x86/shadow.h      Thu Feb 08 10:44:53 2007 +0000
@@ -355,8 +355,9 @@ static inline void
 static inline void 
 shadow_drop_references(struct domain *d, struct page_info *p)
 {
-    /* See the comment about locking in sh_remove_all_mappings */
-    sh_remove_all_mappings(d->vcpu[0], _mfn(page_to_mfn(p)));
+    if ( unlikely(shadow_mode_enabled(d)) )
+        /* See the comment about locking in sh_remove_all_mappings */
+        sh_remove_all_mappings(d->vcpu[0], _mfn(page_to_mfn(p)));
 }
 
 /* Remove all shadows of the guest mfn. */

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


 


Rackspace

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