x86 shadow: Cleanup for early-unshadow code.
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 4 Feb 2008 13:51:17 +0000 (13:51 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 4 Feb 2008 13:51:17 +0000 (13:51 +0000)
The unhooking of toplevel shadow entries has been removed; the rest of
the early-unshadow code needs to reflect that.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
xen/arch/x86/mm/shadow/multi.c
xen/arch/x86/mm/shadow/private.h

index c9f16bf4bb8f63874d20d7a1dc7f82f1e50953dc..f12a97fbde02cd1d8fee16addeb07f8790db78d0 100644 (file)
@@ -2588,19 +2588,15 @@ sh_map_and_validate_gl1e(struct vcpu *v, mfn_t gl1mfn,
  * easier. */
 
 /* Look to see if this is the second emulated write in a row to this
- * page, and unshadow/unhook if it is */
+ * page, and unshadow if it is */
 static inline void check_for_early_unshadow(struct vcpu *v, mfn_t gmfn)
 {
 #if SHADOW_OPTIMIZATIONS & SHOPT_EARLY_UNSHADOW
     if ( v->arch.paging.shadow.last_emulated_mfn == mfn_x(gmfn) &&
          sh_mfn_is_a_page_table(gmfn) )
     {
-        u32 flags = mfn_to_page(gmfn)->shadow_flags;
-        if ( !(flags & (SHF_L2_32|SHF_L2_PAE|SHF_L2H_PAE|SHF_L4_64)) )
-        {
-            perfc_incr(shadow_early_unshadow);
-            sh_remove_shadows(v, gmfn, 1, 0 /* Fast, can fail to unshadow */ );
-        } 
+        perfc_incr(shadow_early_unshadow);
+        sh_remove_shadows(v, gmfn, 1, 0 /* Fast, can fail to unshadow */ );
     }
     v->arch.paging.shadow.last_emulated_mfn = mfn_x(gmfn);
 #endif
@@ -3487,12 +3483,6 @@ sh_set_toplevel_shadow(struct vcpu *v,
     }
     ASSERT(mfn_valid(smfn));
     
-#if SHADOW_OPTIMIZATIONS & SHOPT_EARLY_UNSHADOW
-    /* Once again OK to unhook entries from this table if we see fork/exit */
-    ASSERT(sh_mfn_is_a_page_table(gmfn));
-    mfn_to_page(gmfn)->shadow_flags &= ~SHF_unhooked_mappings;
-#endif
-
     /* Pin the shadow and put it (back) on the list of pinned shadows */
     if ( sh_pin(v, smfn) == 0 )
     {
index 72a41d9a74ff406dda05efc7aa937ce7ffac8a2b..82d1e9e9b864fca0b4effbf64281e43b5c35df56 100644 (file)
@@ -334,9 +334,6 @@ static inline int sh_type_is_pinnable(struct vcpu *v, unsigned int t)
 #define SHF_PAE (SHF_L1_PAE|SHF_FL1_PAE|SHF_L2_PAE|SHF_L2H_PAE)
 #define SHF_64  (SHF_L1_64|SHF_FL1_64|SHF_L2_64|SHF_L2H_64|SHF_L3_64|SHF_L4_64)
 
-/* Used for hysteresis when automatically unhooking mappings on fork/exit */
-#define SHF_unhooked_mappings (1u<<31)
-
 
 /******************************************************************************
  * Various function declarations