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

[Xen-changelog] [xen-unstable] x86 shadow: don't try to unsshadow for p2m changes after the shadows



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1259235076 0
# Node ID e6515469c466f5c43a0927d72129a3ecd2289cb7
# Parent  a92e9fa2639d13f859c82a3ac255fb3c54226688
x86 shadow: don't try to unsshadow for p2m changes after the shadows
have been torn down.

Signed-off-by: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
---
 xen/arch/x86/mm/shadow/common.c |   25 +++++++++++++++++++------
 1 files changed, 19 insertions(+), 6 deletions(-)

diff -r a92e9fa2639d -r e6515469c466 xen/arch/x86/mm/shadow/common.c
--- a/xen/arch/x86/mm/shadow/common.c   Thu Nov 26 11:30:42 2009 +0000
+++ b/xen/arch/x86/mm/shadow/common.c   Thu Nov 26 11:31:16 2009 +0000
@@ -3440,14 +3440,12 @@ static int shadow_test_disable(struct do
  * with new content. It is responsible for update the entry, as well as other 
  * shadow processing jobs.
  */
-void
-shadow_write_p2m_entry(struct vcpu *v, unsigned long gfn, 
-                       l1_pgentry_t *p, mfn_t table_mfn, 
-                       l1_pgentry_t new, unsigned int level)
+
+static void sh_unshadow_for_p2m_change(struct vcpu *v, unsigned long gfn, 
+                                       l1_pgentry_t *p, mfn_t table_mfn, 
+                                       l1_pgentry_t new, unsigned int level)
 {
     struct domain *d = v->domain;
-    
-    shadow_lock(d);
 
     /* If we're removing an MFN from the p2m, remove it from the shadows too */
     if ( level == 1 )
@@ -3503,6 +3501,21 @@ shadow_write_p2m_entry(struct vcpu *v, u
                 unmap_domain_page(npte);
         }
     }
+}
+
+void
+shadow_write_p2m_entry(struct vcpu *v, unsigned long gfn, 
+                       l1_pgentry_t *p, mfn_t table_mfn, 
+                       l1_pgentry_t new, unsigned int level)
+{
+    struct domain *d = v->domain;
+    
+    shadow_lock(d);
+
+    /* If there are any shadows, update them.  But if shadow_teardown()
+     * has already been called then it's not safe to try. */ 
+    if ( likely(d->arch.paging.shadow.total_pages != 0) )
+         sh_unshadow_for_p2m_change(v, gfn, p, table_mfn, new, level);
 
     /* Update the entry with new content */
     safe_write_pte(p, new);

_______________________________________________
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®.