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

[Xen-changelog] Fix the issue of system crash in vmx stress test.



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 4b1efe4c9e0b643079560ac6e20f1088742f5ae6
# Parent  468d2a6fc0afb7eec5944b90661208d13a6e1c73
Fix the issue of system crash in vmx stress test.
There is a path that shadow L2 table is assigned
after it is unshadowed in stress test.

Signed-off-by: Xiaofeng Ling <xiaofeng.ling@xxxxxxxxx>

diff -r 468d2a6fc0af -r 4b1efe4c9e0b xen/arch/x86/shadow.c
--- a/xen/arch/x86/shadow.c     Fri Jan 13 22:41:28 2006
+++ b/xen/arch/x86/shadow.c     Sat Jan 14 09:35:39 2006
@@ -2138,6 +2138,7 @@
 #if CONFIG_PAGING_LEVELS == 2
     unsigned long hl2mfn;
 #endif
+    int need_sync = 0;
 
     int max_mode = ( shadow_mode_external(d) ? SHM_external
                      : shadow_mode_translate(d) ? SHM_translate
@@ -2169,8 +2170,17 @@
 #elif CONFIG_PAGING_LEVELS == 4
         smfn = shadow_l4_table(d, gpfn, gmfn);
 #endif
-    }else
-        shadow_sync_all(d);
+    }
+    else
+    {
+        /*
+         *  move sync later in order to avoid this smfn been 
+         *  unshadowed occasionally
+         */
+        need_sync = 1;
+    }
+
+
     if ( !get_shadow_ref(smfn) )
         BUG();
     old_smfn = pagetable_get_pfn(v->arch.shadow_table);
@@ -2240,6 +2250,9 @@
         local_flush_tlb();
     }
 #endif /* CONFIG_PAGING_LEVELS == 2 */
+
+    if(likely(need_sync))
+        shadow_sync_all(d);
 
 #if CONFIG_PAGING_LEVELS == 3
     /* FIXME: PAE code to be written */
diff -r 468d2a6fc0af -r 4b1efe4c9e0b xen/arch/x86/shadow32.c
--- a/xen/arch/x86/shadow32.c   Fri Jan 13 22:41:28 2006
+++ b/xen/arch/x86/shadow32.c   Sat Jan 14 09:35:39 2006
@@ -2896,6 +2896,7 @@
     unsigned long gmfn = pagetable_get_pfn(v->arch.guest_table);
     unsigned long gpfn = __mfn_to_gpfn(d, gmfn);
     unsigned long smfn, hl2mfn, old_smfn;
+    int need_sync = 0;
 
     int max_mode = ( shadow_mode_external(d) ? SHM_external
                      : shadow_mode_translate(d) ? SHM_translate
@@ -2921,7 +2922,13 @@
     if ( unlikely(!(smfn = __shadow_status(d, gpfn, PGT_base_page_table))) )
         smfn = shadow_l2_table(d, gpfn, gmfn);
     else
-        shadow_sync_all(d);
+    {
+        /*
+         *  move sync later in order to avoid this smfn been 
+         *  unshadowed occasionally
+         */
+        need_sync = 1;
+    }
     if ( !get_shadow_ref(smfn) )
         BUG();
     old_smfn = pagetable_get_pfn(v->arch.shadow_table);
@@ -2985,6 +2992,9 @@
         // XXX - maybe this can be optimized somewhat??
         local_flush_tlb();
     }
+
+    if(likely(need_sync))
+        shadow_sync_all(d);
 }
 
 void clear_all_shadow_status(struct domain *d)

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