ia64/xen-unstable

changeset 18331:d09404ad5730

x86 shadow: Fix OOS typecounting.

From: Gianluca Guida <gianluca.guida@eu.citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Aug 14 16:26:06 2008 +0100 (2008-08-14)
parents d3947223dfae
children a1e4279bddee
files xen/arch/x86/mm/shadow/multi.c
line diff
     1.1 --- a/xen/arch/x86/mm/shadow/multi.c	Thu Aug 14 13:46:48 2008 +0100
     1.2 +++ b/xen/arch/x86/mm/shadow/multi.c	Thu Aug 14 16:26:06 2008 +0100
     1.3 @@ -1415,6 +1415,13 @@ static int shadow_set_l1e(struct vcpu *v
     1.4      mfn_t new_gmfn = shadow_l1e_get_mfn(new_sl1e);
     1.5  #endif
     1.6      ASSERT(sl1e != NULL);
     1.7 +
     1.8 +#if SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC
     1.9 +    if ( mfn_valid(new_gmfn) && mfn_oos_may_write(new_gmfn)
    1.10 +         && ((shadow_l1e_get_flags(new_sl1e) & (_PAGE_RW|_PAGE_PRESENT))
    1.11 +             == (_PAGE_RW|_PAGE_PRESENT)) )
    1.12 +        oos_fixup_add(v, new_gmfn, sl1mfn, pgentry_ptr_to_slot(sl1e));
    1.13 +#endif
    1.14      
    1.15      old_sl1e = *sl1e;
    1.16  
    1.17 @@ -1434,14 +1441,6 @@ static int shadow_set_l1e(struct vcpu *v
    1.18              else
    1.19              {
    1.20                  shadow_vram_get_l1e(new_sl1e, sl1e, sl1mfn, d);
    1.21 -#if SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC
    1.22 -                if ( mfn_valid(new_gmfn) && mfn_oos_may_write(new_gmfn)
    1.23 -                     && (shadow_l1e_get_flags(new_sl1e) & _PAGE_RW) )
    1.24 -                {
    1.25 -                    oos_fixup_add(v, new_gmfn, sl1mfn, pgentry_ptr_to_slot(sl1e));
    1.26 -                }
    1.27 -#endif
    1.28 -
    1.29              }
    1.30          }
    1.31      }