diff -r 176b4c8e2c4b xen/arch/x86/hvm/hvm.c --- a/xen/arch/x86/hvm/hvm.c Wed Dec 02 13:45:35 2009 +0000 +++ b/xen/arch/x86/hvm/hvm.c Wed Dec 02 16:24:30 2009 +0000 @@ -927,7 +927,7 @@ * If this GFN is emulated MMIO or marked as read-only, pass the fault * to the mmio handler. */ - if ( p2m_is_mmio(p2mt) || (p2mt == p2m_ram_ro) ) + if ( (p2mt == p2m_mmio_dm) || (p2mt == p2m_ram_ro) ) { if ( !handle_mmio() ) hvm_inject_exception(TRAP_gp_fault, 0, 0); @@ -935,7 +935,8 @@ } /* Log-dirty: mark the page dirty and let the guest write it again */ - if ( p2mt == p2m_ram_logdirty ) + if ( paging_mode_log_dirty(current->domain) + && p2m_is_ram(p2mt) && (p2mt != p2m_ram_ro) ) { paging_mark_dirty(current->domain, mfn_x(mfn)); p2m_change_type(current->domain, gfn, p2m_ram_logdirty, p2m_ram_rw);