ia64/xen-unstable

changeset 2573:a98106d86aa2

bitkeeper revision 1.1159.97.2 (415c13cd5VJC1zwMGjzqOrsURvQiOQ)

Move the shadow LDT test later in the pagefault handler.
It's a bug fix, but I doubt anyone ever hit it.
author iap10@labyrinth.cl.cam.ac.uk
date Thu Sep 30 14:10:21 2004 +0000 (2004-09-30)
parents 5109394e871c
children 1293cc819fed
files xen/arch/x86/traps.c
line diff
     1.1 --- a/xen/arch/x86/traps.c	Thu Sep 30 14:08:21 2004 +0000
     1.2 +++ b/xen/arch/x86/traps.c	Thu Sep 30 14:10:21 2004 +0000
     1.3 @@ -344,18 +344,6 @@ asmlinkage void do_page_fault(struct pt_
     1.4  
     1.5      ASSERT_no_criticalregion();
     1.6  
     1.7 -    if ( unlikely(addr >= LDT_VIRT_START) && 
     1.8 -         (addr < (LDT_VIRT_START + (d->mm.ldt_ents*LDT_ENTRY_SIZE))) )
     1.9 -    {
    1.10 -        /*
    1.11 -         * Copy a mapping from the guest's LDT, if it is valid. Otherwise we
    1.12 -         * send the fault up to the guest OS to be handled.
    1.13 -         */
    1.14 -        off  = addr - LDT_VIRT_START;
    1.15 -        addr = d->mm.ldt_base + off;
    1.16 -        if ( likely(map_ldt_shadow_page(off >> PAGE_SHIFT)) )
    1.17 -            return; /* successfully copied the mapping */
    1.18 -    }
    1.19  
    1.20      if ( likely(VM_ASSIST(d, VMASST_TYPE_writable_pagetables)) )
    1.21      {
    1.22 @@ -377,6 +365,19 @@ asmlinkage void do_page_fault(struct pt_
    1.23           (addr < PAGE_OFFSET) && shadow_fault(addr, error_code) )
    1.24          return; /* Returns TRUE if fault was handled. */
    1.25  
    1.26 +    if ( unlikely(addr >= LDT_VIRT_START) && 
    1.27 +         (addr < (LDT_VIRT_START + (d->mm.ldt_ents*LDT_ENTRY_SIZE))) )
    1.28 +    {
    1.29 +        /*
    1.30 +         * Copy a mapping from the guest's LDT, if it is valid. Otherwise we
    1.31 +         * send the fault up to the guest OS to be handled.
    1.32 +         */
    1.33 +        off  = addr - LDT_VIRT_START;
    1.34 +        addr = d->mm.ldt_base + off;
    1.35 +        if ( likely(map_ldt_shadow_page(off >> PAGE_SHIFT)) )
    1.36 +            return; /* successfully copied the mapping */
    1.37 +    }
    1.38 +
    1.39      if ( unlikely(!(regs->xcs & 3)) )
    1.40          goto xen_fault;
    1.41