direct-io.hg

changeset 5538:52010370d2ed

bitkeeper revision 1.1726.1.3 (42b9a279xCcev3J_vAFv3hHoqI8lVw)

Add cmpxchg8b support for writable page tables
(emulation code path), which is needed to make atomic pae l1
page table updates work.
Signed-off-by: Scott Parish <srparish@us.ibm.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Jun 22 17:40:09 2005 +0000 (2005-06-22)
parents 15498ad4f5e0
children a907e4db8c7e
files xen/arch/x86/mm.c
line diff
     1.1 --- a/xen/arch/x86/mm.c	Wed Jun 22 14:45:48 2005 +0000
     1.2 +++ b/xen/arch/x86/mm.c	Wed Jun 22 17:40:09 2005 +0000
     1.3 @@ -2793,12 +2793,24 @@ static int ptwr_emulated_cmpxchg(
     1.4      return ptwr_emulated_update(addr, old, new, bytes, 1);
     1.5  }
     1.6  
     1.7 +static int ptwr_emulated_cmpxchg8b(
     1.8 +    unsigned long addr,
     1.9 +    unsigned long old,
    1.10 +    unsigned long old_hi,
    1.11 +    unsigned long new,
    1.12 +    unsigned long new_hi)
    1.13 +{
    1.14 +    return ptwr_emulated_update(
    1.15 +        addr, ((u64)old_hi << 32) | old, ((u64)new_hi << 32) | new, 8, 1);
    1.16 +}
    1.17 +
    1.18  static struct x86_mem_emulator ptwr_mem_emulator = {
    1.19 -    .read_std         = x86_emulate_read_std,
    1.20 -    .write_std        = x86_emulate_write_std,
    1.21 -    .read_emulated    = x86_emulate_read_std,
    1.22 -    .write_emulated   = ptwr_emulated_write,
    1.23 -    .cmpxchg_emulated = ptwr_emulated_cmpxchg
    1.24 +    .read_std           = x86_emulate_read_std,
    1.25 +    .write_std          = x86_emulate_write_std,
    1.26 +    .read_emulated      = x86_emulate_read_std,
    1.27 +    .write_emulated     = ptwr_emulated_write,
    1.28 +    .cmpxchg_emulated   = ptwr_emulated_cmpxchg,
    1.29 +    .cmpxchg8b_emulated = ptwr_emulated_cmpxchg8b
    1.30  };
    1.31  
    1.32  /* Write page fault handler: check if guest is trying to modify a PTE. */