direct-io.hg

changeset 7794:4f03592bc7f5

Flush writable pagetable state before emulating a PT
update. Avoids possibility of updating a PTE temporarily
marked writable by ptwr batching logic, which can corrupt
page reference counts. Aiee!

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Mon Nov 14 18:27:11 2005 +0100 (2005-11-14)
parents 090e44133d40
children dd754654d427
files xen/arch/x86/mm.c
line diff
     1.1 --- a/xen/arch/x86/mm.c	Mon Nov 14 18:13:38 2005 +0100
     1.2 +++ b/xen/arch/x86/mm.c	Mon Nov 14 18:27:11 2005 +0100
     1.3 @@ -3358,6 +3358,13 @@ int ptwr_do_page_fault(struct domain *d,
     1.4      return EXCRET_fault_fixed;
     1.5  
     1.6   emulate:
     1.7 +    /*
     1.8 +     * Cleaning up avoids emulating an update to a PTE that is temporarily
     1.9 +     * marked writable (_PAGE_RW) by the batched ptwr logic. If this were
    1.10 +     * performance critical then the check could compare addr against l1va's in
    1.11 +     * ptwr_emulated_update(). Without this flush we can corrupt page refcnts!
    1.12 +     */
    1.13 +    cleanup_writable_pagetable(d);
    1.14      if ( x86_emulate_memop(guest_cpu_user_regs(), addr,
    1.15                             &ptwr_mem_emulator, BITS_PER_LONG/8) )
    1.16          return 0;