diff -r 66221b72bb01 xen/arch/x86/mm/hap/hap.c --- a/xen/arch/x86/mm/hap/hap.c Mon Oct 20 15:16:54 2008 +0100 +++ b/xen/arch/x86/mm/hap/hap.c Mon Oct 20 15:33:07 2008 +0100 @@ -639,9 +639,16 @@ hap_write_p2m_entry(struct vcpu *v, unsi hap_write_p2m_entry(struct vcpu *v, unsigned long gfn, l1_pgentry_t *p, mfn_t table_mfn, l1_pgentry_t new, unsigned int level) { + uint32_t old_flags; + hap_lock(v->domain); + old_flags = l1e_get_flags(*p); safe_write_pte(p, new); + if ( (old_flags & _PAGE_PRESENT) + && (level == 1 || (level == 2 && (old_flags & _PAGE_PSE))) ) + flush_tlb_mask(v->domain->domain_dirty_cpumask); + #if CONFIG_PAGING_LEVELS == 3 /* install P2M in monitor table for PAE Xen */ if ( level == 3 )