ia64/xen-unstable

changeset 12441:a07d6a05792e

[XEN] Extend fix from 12403:680b37789200 to other emulation paths.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
author Tim Deegan <Tim.Deegan@xensource.com>
date Tue Nov 14 17:11:45 2006 +0000 (2006-11-14)
parents bb76a76985fe
children 394da2dfb70d
files xen/arch/x86/mm/shadow/multi.c
line diff
     1.1 --- a/xen/arch/x86/mm/shadow/multi.c	Tue Nov 14 17:00:05 2006 +0000
     1.2 +++ b/xen/arch/x86/mm/shadow/multi.c	Tue Nov 14 17:11:45 2006 +0000
     1.3 @@ -3778,7 +3778,7 @@ sh_x86_emulate_write(struct vcpu *v, uns
     1.4          shadow_validate_guest_pt_write(v, mfn, addr, bytes_on_page);
     1.5          bytes -= bytes_on_page;
     1.6          /* If we are writing zeros to this page, might want to unshadow */
     1.7 -        if ( *(u32 *)addr == 0 )
     1.8 +        if ( likely(bytes_on_page >= 4) && (*(u32 *)addr == 0) )
     1.9              check_for_early_unshadow(v, mfn);
    1.10          sh_unmap_domain_page(addr);
    1.11      }
    1.12 @@ -3823,7 +3823,7 @@ sh_x86_emulate_cmpxchg(struct vcpu *v, u
    1.13                    vaddr, prev, old, new, *(unsigned long *)addr, bytes);
    1.14  
    1.15      /* If we are writing zeros to this page, might want to unshadow */
    1.16 -    if ( *(u8 *)addr == 0 )
    1.17 +    if ( likely(bytes >= 4) && (*(u32 *)addr == 0) )
    1.18          check_for_early_unshadow(v, mfn);
    1.19  
    1.20      sh_unmap_domain_page(addr);
    1.21 @@ -3858,7 +3858,7 @@ sh_x86_emulate_cmpxchg8b(struct vcpu *v,
    1.22          rv = X86EMUL_CMPXCHG_FAILED;
    1.23  
    1.24      /* If we are writing zeros to this page, might want to unshadow */
    1.25 -    if ( *(u8 *)addr == 0 )
    1.26 +    if ( *(u32 *)addr == 0 )
    1.27          check_for_early_unshadow(v, mfn);
    1.28  
    1.29      sh_unmap_domain_page(addr);