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

[Xen-changelog] Clean wrpt state when emulating CR3 write.



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID bd816eee9cf68f457e88589b301de2300462435e
# Parent  a376bab39768941c46cb57f3a3ce2dca2edb4173
Clean wrpt state when emulating CR3 write.

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r a376bab39768 -r bd816eee9cf6 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c Tue Feb 28 21:57:38 2006
+++ b/xen/arch/x86/mm.c Wed Mar  1 13:49:31 2006
@@ -475,7 +475,8 @@
     {
         MEM_LOG("Error getting mfn %lx (pfn %lx) from L1 entry %" PRIpte
                 " for dom%d",
-                mfn, get_gpfn_from_mfn(mfn), l1e_get_intpte(l1e), 
d->domain_id);
+                mfn, get_gpfn_from_mfn(mfn),
+                l1e_get_intpte(l1e), d->domain_id);
     }
 
     return okay;
@@ -515,7 +516,6 @@
 
 
 #if CONFIG_PAGING_LEVELS >= 3
-
 static int 
 get_page_from_l3e(
     l3_pgentry_t l3e, unsigned long pfn,
@@ -545,11 +545,9 @@
 #endif
     return rc;
 }
-
 #endif /* 3 level */
 
 #if CONFIG_PAGING_LEVELS >= 4
-
 static int 
 get_page_from_l4e(
     l4_pgentry_t l4e, unsigned long pfn, 
@@ -579,7 +577,6 @@
 
     return rc;
 }
-
 #endif /* 4 level */
 
 
@@ -649,27 +646,22 @@
 
 
 #if CONFIG_PAGING_LEVELS >= 3
-
 static void put_page_from_l3e(l3_pgentry_t l3e, unsigned long pfn)
 {
     if ( (l3e_get_flags(l3e) & _PAGE_PRESENT) && 
          (l3e_get_pfn(l3e) != pfn) )
         put_page_and_type(mfn_to_page(l3e_get_pfn(l3e)));
 }
-
 #endif
 
 #if CONFIG_PAGING_LEVELS >= 4
-
 static void put_page_from_l4e(l4_pgentry_t l4e, unsigned long pfn)
 {
     if ( (l4e_get_flags(l4e) & _PAGE_PRESENT) && 
          (l4e_get_pfn(l4e) != pfn) )
         put_page_and_type(mfn_to_page(l4e_get_pfn(l4e)));
 }
-
 #endif
-
 
 static int alloc_l1_table(struct page_info *page)
 {
@@ -1569,6 +1561,8 @@
     int okay;
     unsigned long old_base_mfn;
 
+    ASSERT(writable_pagetable_in_sync(d));
+
     if ( shadow_mode_refcounts(d) )
     {
         okay = get_page_from_pagenr(mfn, d);
diff -r a376bab39768 -r bd816eee9cf6 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c      Tue Feb 28 21:57:38 2006
+++ b/xen/arch/x86/traps.c      Wed Mar  1 13:49:31 2006
@@ -951,6 +951,7 @@
             
         case 3: /* Write CR3 */
             LOCK_BIGLOCK(v->domain);
+            cleanup_writable_pagetable(v->domain);
             (void)new_guest_cr3(gmfn_to_mfn(v->domain, paddr_to_pfn(*reg)));
             UNLOCK_BIGLOCK(v->domain);
             break;
diff -r a376bab39768 -r bd816eee9cf6 xen/include/asm-x86/mm.h
--- a/xen/include/asm-x86/mm.h  Tue Feb 28 21:57:38 2006
+++ b/xen/include/asm-x86/mm.h  Wed Mar  1 13:49:31 2006
@@ -337,6 +337,10 @@
         UNLOCK_BIGLOCK(d);                                      \
     } while ( 0 )
 
+#define writable_pagetable_in_sync(d)           \
+    (!((d)->arch.ptwr[PTWR_PT_ACTIVE].l1va |    \
+       (d)->arch.ptwr[PTWR_PT_INACTIVE].l1va))
+
 int audit_adjust_pgtables(struct domain *d, int dir, int noisy);
 
 #ifndef NDEBUG

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