ia64/xen-unstable

changeset 13454:0fd65225e4c6

[XEN] Fix PAE writable-pte fixup to only trigger on writes to upper
half the the PAE PTE.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
author kfraser@localhost.localdomain
date Wed Jan 17 14:37:45 2007 +0000 (2007-01-17)
parents e798c9010e93
children 84b7639a3bd4
files xen/arch/x86/mm.c
line diff
     1.1 --- a/xen/arch/x86/mm.c	Wed Jan 17 14:03:12 2007 +0000
     1.2 +++ b/xen/arch/x86/mm.c	Wed Jan 17 14:37:45 2007 +0000
     1.3 @@ -3236,15 +3236,14 @@ static int ptwr_emulated_update(
     1.4      if ( unlikely(!get_page_from_l1e(gl1e_to_ml1e(d, nl1e), d)) )
     1.5      {
     1.6          if ( (CONFIG_PAGING_LEVELS == 3 || IS_COMPAT(d)) &&
     1.7 -             (bytes == 4) &&
     1.8 -             !do_cmpxchg &&
     1.9 +             (bytes == 4) && (addr & 4) && !do_cmpxchg &&
    1.10               (l1e_get_flags(nl1e) & _PAGE_PRESENT) )
    1.11          {
    1.12              /*
    1.13 -             * If this is a half-write to a PAE PTE then we assume that the
    1.14 -             * guest has simply got the two writes the wrong way round. We
    1.15 -             * zap the PRESENT bit on the assumption the bottom half will be
    1.16 -             * written immediately after we return to the guest.
    1.17 +             * If this is an upper-half write to a PAE PTE then we assume that
    1.18 +             * the guest has simply got the two writes the wrong way round. We
    1.19 +             * zap the PRESENT bit on the assumption that the bottom half will
    1.20 +             * be written immediately after we return to the guest.
    1.21               */
    1.22              MEM_LOG("ptwr_emulate: fixing up invalid PAE PTE %"PRIpte,
    1.23                      l1e_get_intpte(nl1e));
    1.24 @@ -3375,7 +3374,7 @@ int ptwr_do_page_fault(struct vcpu *v, u
    1.25           (page_get_owner(page) != d) )
    1.26          goto bail;
    1.27  
    1.28 -    ptwr_ctxt.ctxt.regs = guest_cpu_user_regs();
    1.29 +    ptwr_ctxt.ctxt.regs = regs;
    1.30      ptwr_ctxt.ctxt.addr_size = ptwr_ctxt.ctxt.sp_size =
    1.31          IS_COMPAT(d) ? 32 : BITS_PER_LONG;
    1.32      ptwr_ctxt.cr2 = addr;