ia64/xen-unstable

changeset 16976:7e6a705e8ec5

x86 shadow: Cleanup for early-unshadow code.

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>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Feb 04 13:51:17 2008 +0000 (2008-02-04)
parents 4e9b5427f2d8
children 99b8ffe25088
files xen/arch/x86/mm/shadow/multi.c xen/arch/x86/mm/shadow/private.h
line diff
     1.1 --- a/xen/arch/x86/mm/shadow/multi.c	Mon Feb 04 13:44:29 2008 +0000
     1.2 +++ b/xen/arch/x86/mm/shadow/multi.c	Mon Feb 04 13:51:17 2008 +0000
     1.3 @@ -2588,19 +2588,15 @@ sh_map_and_validate_gl1e(struct vcpu *v,
     1.4   * easier. */
     1.5  
     1.6  /* Look to see if this is the second emulated write in a row to this
     1.7 - * page, and unshadow/unhook if it is */
     1.8 + * page, and unshadow if it is */
     1.9  static inline void check_for_early_unshadow(struct vcpu *v, mfn_t gmfn)
    1.10  {
    1.11  #if SHADOW_OPTIMIZATIONS & SHOPT_EARLY_UNSHADOW
    1.12      if ( v->arch.paging.shadow.last_emulated_mfn == mfn_x(gmfn) &&
    1.13           sh_mfn_is_a_page_table(gmfn) )
    1.14      {
    1.15 -        u32 flags = mfn_to_page(gmfn)->shadow_flags;
    1.16 -        if ( !(flags & (SHF_L2_32|SHF_L2_PAE|SHF_L2H_PAE|SHF_L4_64)) )
    1.17 -        {
    1.18 -            perfc_incr(shadow_early_unshadow);
    1.19 -            sh_remove_shadows(v, gmfn, 1, 0 /* Fast, can fail to unshadow */ );
    1.20 -        } 
    1.21 +        perfc_incr(shadow_early_unshadow);
    1.22 +        sh_remove_shadows(v, gmfn, 1, 0 /* Fast, can fail to unshadow */ );
    1.23      }
    1.24      v->arch.paging.shadow.last_emulated_mfn = mfn_x(gmfn);
    1.25  #endif
    1.26 @@ -3487,12 +3483,6 @@ sh_set_toplevel_shadow(struct vcpu *v,
    1.27      }
    1.28      ASSERT(mfn_valid(smfn));
    1.29      
    1.30 -#if SHADOW_OPTIMIZATIONS & SHOPT_EARLY_UNSHADOW
    1.31 -    /* Once again OK to unhook entries from this table if we see fork/exit */
    1.32 -    ASSERT(sh_mfn_is_a_page_table(gmfn));
    1.33 -    mfn_to_page(gmfn)->shadow_flags &= ~SHF_unhooked_mappings;
    1.34 -#endif
    1.35 -
    1.36      /* Pin the shadow and put it (back) on the list of pinned shadows */
    1.37      if ( sh_pin(v, smfn) == 0 )
    1.38      {
     2.1 --- a/xen/arch/x86/mm/shadow/private.h	Mon Feb 04 13:44:29 2008 +0000
     2.2 +++ b/xen/arch/x86/mm/shadow/private.h	Mon Feb 04 13:51:17 2008 +0000
     2.3 @@ -334,9 +334,6 @@ static inline int sh_type_is_pinnable(st
     2.4  #define SHF_PAE (SHF_L1_PAE|SHF_FL1_PAE|SHF_L2_PAE|SHF_L2H_PAE)
     2.5  #define SHF_64  (SHF_L1_64|SHF_FL1_64|SHF_L2_64|SHF_L2H_64|SHF_L3_64|SHF_L4_64)
     2.6  
     2.7 -/* Used for hysteresis when automatically unhooking mappings on fork/exit */
     2.8 -#define SHF_unhooked_mappings (1u<<31)
     2.9 -
    2.10  
    2.11  /******************************************************************************
    2.12   * Various function declarations