direct-io.hg

changeset 800:b33875f82bbb

bitkeeper revision 1.489 (3f831c7avBom96QV85aqKhJrQbXHUQ)

traps.c:
Faster handling of LDT shadow mapping.
author kaf24@scramble.cl.cam.ac.uk
date Tue Oct 07 20:05:14 2003 +0000 (2003-10-07)
parents 3d5ab61162dc
children 209fcea923d4
files xen/arch/i386/traps.c
line diff
     1.1 --- a/xen/arch/i386/traps.c	Tue Oct 07 19:34:30 2003 +0000
     1.2 +++ b/xen/arch/i386/traps.c	Tue Oct 07 20:05:14 2003 +0000
     1.3 @@ -290,9 +290,7 @@ asmlinkage void do_page_fault(struct pt_
     1.4  {
     1.5      struct guest_trap_bounce *gtb = guest_trap_bounce+smp_processor_id();
     1.6      trap_info_t *ti;
     1.7 -    l2_pgentry_t *pl2e;
     1.8 -    l1_pgentry_t *pl1e;
     1.9 -    unsigned long addr, off, fixup, l2e, l1e, *ldt_page;
    1.10 +    unsigned long addr, off, fixup, l1e, *ldt_page;
    1.11      struct task_struct *p = current;
    1.12      struct pfn_info *page;
    1.13      int i;
    1.14 @@ -334,15 +332,7 @@ asmlinkage void do_page_fault(struct pt_
    1.15  
    1.16      spin_lock(&p->page_lock);
    1.17  
    1.18 -    pl2e  = map_domain_mem(pagetable_val(p->mm.pagetable));
    1.19 -    l2e   = l2_pgentry_val(pl2e[l2_table_offset(addr)]);
    1.20 -    unmap_domain_mem(pl2e);
    1.21 -    if ( !(l2e & _PAGE_PRESENT) )
    1.22 -        goto unlock_and_bounce_fault;
    1.23 -
    1.24 -    pl1e  = map_domain_mem(l2e & PAGE_MASK);
    1.25 -    l1e   = l1_pgentry_val(pl1e[l1_table_offset(addr)]);
    1.26 -    unmap_domain_mem(pl1e);
    1.27 +    __get_user(l1e, (unsigned long *)(linear_pg_table+(addr>>PAGE_SHIFT)));
    1.28      if ( !(l1e & _PAGE_PRESENT) )
    1.29          goto unlock_and_bounce_fault;
    1.30  
    1.31 @@ -353,11 +343,10 @@ asmlinkage void do_page_fault(struct pt_
    1.32              goto unlock_and_bounce_fault;
    1.33  
    1.34          /* Check all potential LDT entries in the page. */
    1.35 -        ldt_page = map_domain_mem(l1e & PAGE_MASK);
    1.36 +        ldt_page = (unsigned long *)(addr & PAGE_MASK);
    1.37          for ( i = 0; i < 512; i++ )
    1.38              if ( !check_descriptor(ldt_page[i*2], ldt_page[i*2+1]) )
    1.39                  goto unlock_and_bounce_fault;
    1.40 -        unmap_domain_mem(ldt_page);
    1.41  
    1.42          if ( page->flags & PG_need_flush )
    1.43          {