ia64/xen-unstable

changeset 14182:7b35a9682d81

[XEN][SHADOW] Fix early-unshadow logic.

Make sure to reset the early-unshadow logic when we
do a fast-path propagate or when we emulate a non-zero
write.

Signed-off-by: George Dunlap <gdunlap@xensource.com>
author George Dunlap <gdunlap@xensource.com>
date Wed Feb 28 11:11:22 2007 -0500 (2007-02-28)
parents d39dcdb9cca3
children 8ba425b640b3
files xen/arch/x86/mm/shadow/multi.c
line diff
     1.1 --- a/xen/arch/x86/mm/shadow/multi.c	Wed Feb 28 14:44:52 2007 +0000
     1.2 +++ b/xen/arch/x86/mm/shadow/multi.c	Wed Feb 28 11:11:22 2007 -0500
     1.3 @@ -2667,6 +2667,7 @@ static int sh_page_fault(struct vcpu *v,
     1.4                       * a not-present fault (by flipping two bits). */
     1.5                      ASSERT(regs->error_code & PFEC_page_present);
     1.6                      regs->error_code ^= (PFEC_reserved_bit|PFEC_page_present);
     1.7 +                    reset_early_unshadow(v);
     1.8                      perfc_incrc(shadow_fault_fast_gnp);
     1.9                      SHADOW_PRINTK("fast path not-present\n");
    1.10                      return 0;
    1.11 @@ -3961,6 +3962,8 @@ sh_x86_emulate_write(struct vcpu *v, uns
    1.12      /* If we are writing zeros to this page, might want to unshadow */
    1.13      if ( likely(bytes >= 4) && (*(u32 *)addr == 0) && is_lo_pte(vaddr) )
    1.14          check_for_early_unshadow(v, mfn);
    1.15 +    else
    1.16 +        reset_early_unshadow(v);
    1.17      
    1.18      sh_mark_dirty(v->domain, mfn);
    1.19  
    1.20 @@ -4015,6 +4018,8 @@ sh_x86_emulate_cmpxchg(struct vcpu *v, u
    1.21      /* If we are writing zeros to this page, might want to unshadow */
    1.22      if ( likely(bytes >= 4) && (*(u32 *)addr == 0) && is_lo_pte(vaddr) )
    1.23          check_for_early_unshadow(v, mfn);
    1.24 +    else
    1.25 +        reset_early_unshadow(v);
    1.26  
    1.27      sh_mark_dirty(v->domain, mfn);
    1.28  
    1.29 @@ -4057,6 +4062,8 @@ sh_x86_emulate_cmpxchg8b(struct vcpu *v,
    1.30      /* If we are writing zeros to this page, might want to unshadow */
    1.31      if ( *(u32 *)addr == 0 )
    1.32          check_for_early_unshadow(v, mfn);
    1.33 +    else
    1.34 +        reset_early_unshadow(v);
    1.35  
    1.36      sh_mark_dirty(v->domain, mfn);
    1.37