ia64/xen-unstable

changeset 6253:0cd6a23b8d6e

Fix emulated writable pagetable updates where access is
less than a full pte and operation requires cmpxchg.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Thu Aug 18 18:02:46 2005 +0000 (2005-08-18)
parents 67a13c0ac87d
children 978ce7f6a3eb
files xen/arch/x86/mm.c
line diff
     1.1 --- a/xen/arch/x86/mm.c	Thu Aug 18 17:46:26 2005 +0000
     1.2 +++ b/xen/arch/x86/mm.c	Thu Aug 18 18:02:46 2005 +0000
     1.3 @@ -3059,7 +3059,7 @@ static int ptwr_emulated_update(
     1.4      }
     1.5  
     1.6      /* Turn a sub-word access into a full-word access. */
     1.7 -    if (bytes != sizeof(physaddr_t))
     1.8 +    if ( bytes != sizeof(physaddr_t) )
     1.9      {
    1.10          int           rc;
    1.11          physaddr_t    full;
    1.12 @@ -3076,6 +3076,10 @@ static int ptwr_emulated_update(
    1.13          val  &= (((physaddr_t)1 << (bytes*8)) - 1);
    1.14          val <<= (offset)*8;
    1.15          val  |= full;
    1.16 +        /* Also fill in missing parts of the cmpxchg old value. */
    1.17 +        old  &= (((physaddr_t)1 << (bytes*8)) - 1);
    1.18 +        old <<= (offset)*8;
    1.19 +        old  |= full;
    1.20      }
    1.21  
    1.22      /* Read the PTE that maps the page being updated. */