debuggers.hg

changeset 20674:3d505c9f1b73

hvm: Fix CR0.WP=0 emulation. Don't take write emulation path for MMIO.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Dec 14 07:52:22 2009 +0000 (2009-12-14)
parents c61953922215
children 2d9c58c29a94
files xen/arch/x86/mm/shadow/common.c xen/arch/x86/mm/shadow/multi.c
line diff
     1.1 --- a/xen/arch/x86/mm/shadow/common.c	Mon Dec 14 07:46:57 2009 +0000
     1.2 +++ b/xen/arch/x86/mm/shadow/common.c	Mon Dec 14 07:52:22 2009 +0000
     1.3 @@ -2752,6 +2752,7 @@ void sh_remove_shadows(struct vcpu *v, m
     1.4      };
     1.5  
     1.6      ASSERT(!(all && fast));
     1.7 +    ASSERT(mfn_valid(gmfn));
     1.8  
     1.9      /* Although this is an externally visible function, we do not know
    1.10       * whether the shadow lock will be held when it is called (since it
     2.1 --- a/xen/arch/x86/mm/shadow/multi.c	Mon Dec 14 07:46:57 2009 +0000
     2.2 +++ b/xen/arch/x86/mm/shadow/multi.c	Mon Dec 14 07:52:22 2009 +0000
     2.3 @@ -3305,7 +3305,8 @@ static int sh_page_fault(struct vcpu *v,
     2.4       * fault was a non-user write to a present page.  */
     2.5      if ( is_hvm_domain(d) 
     2.6           && unlikely(!hvm_wp_enabled(v)) 
     2.7 -         && regs->error_code == (PFEC_write_access|PFEC_page_present) )
     2.8 +         && regs->error_code == (PFEC_write_access|PFEC_page_present)
     2.9 +         && mfn_valid(gmfn) )
    2.10      {
    2.11          perfc_incr(shadow_fault_emulate_wp);
    2.12          goto emulate;