ia64/xen-unstable

changeset 3148:8b8852411a96

bitkeeper revision 1.1159.1.457 (41a6208fnzPMz8K5OTxEm1zY27pA-w)

traps.c, memory.c:
Reposition big lock around writable pagetable fault handler.
author cl349@arcadians.cl.cam.ac.uk
date Thu Nov 25 18:12:31 2004 +0000 (2004-11-25)
parents 2a161976f1d7
children 0373a9f51f2a
files xen/arch/x86/memory.c xen/arch/x86/traps.c
line diff
     1.1 --- a/xen/arch/x86/memory.c	Thu Nov 25 18:11:19 2004 +0000
     1.2 +++ b/xen/arch/x86/memory.c	Thu Nov 25 18:12:31 2004 +0000
     1.3 @@ -1761,9 +1761,7 @@ int ptwr_do_page_fault(unsigned long add
     1.4      l2_pgentry_t    *pl2e;
     1.5      int              which, cpu = smp_processor_id();
     1.6      u32              l2_idx;
     1.7 -    struct domain   *d = current->domain;
     1.8  
     1.9 -    LOCK_BIGLOCK(d);
    1.10      /*
    1.11       * Attempt to read the PTE that maps the VA being accessed. By checking for
    1.12       * PDE validity in the L2 we avoid many expensive fixups in __get_user().
    1.13 @@ -1772,7 +1770,6 @@ int ptwr_do_page_fault(unsigned long add
    1.14             _PAGE_PRESENT) ||
    1.15           __get_user(pte, (unsigned long *)&linear_pg_table[addr>>PAGE_SHIFT]) )
    1.16      {
    1.17 -        UNLOCK_BIGLOCK(d);
    1.18          return 0;
    1.19      }
    1.20  
    1.21 @@ -1783,7 +1780,6 @@ int ptwr_do_page_fault(unsigned long add
    1.22      if ( ((pte & (_PAGE_RW | _PAGE_PRESENT)) != _PAGE_PRESENT) ||
    1.23           ((page->u.inuse.type_info & PGT_type_mask) != PGT_l1_page_table) )
    1.24      {
    1.25 -        UNLOCK_BIGLOCK(d);
    1.26          return 0;
    1.27      }
    1.28      
    1.29 @@ -1791,7 +1787,6 @@ int ptwr_do_page_fault(unsigned long add
    1.30      l2_idx = page->u.inuse.type_info & PGT_va_mask;
    1.31      if ( unlikely(l2_idx >= PGT_va_unknown) )
    1.32      {
    1.33 -        UNLOCK_BIGLOCK(d);
    1.34          domain_crash(); /* Urk! This L1 is mapped in multiple L2 slots! */
    1.35      }
    1.36      l2_idx >>= PGT_va_shift;
    1.37 @@ -1870,12 +1865,9 @@ int ptwr_do_page_fault(unsigned long add
    1.38          /* Toss the writable pagetable state and crash. */
    1.39          unmap_domain_mem(ptwr_info[cpu].ptinfo[which].pl1e);
    1.40          ptwr_info[cpu].ptinfo[which].l1va = 0;
    1.41 -        UNLOCK_BIGLOCK(d);
    1.42          domain_crash();
    1.43      }
    1.44      
    1.45 -    UNLOCK_BIGLOCK(d);
    1.46 -
    1.47      return EXCRET_fault_fixed;
    1.48  }
    1.49  
     2.1 --- a/xen/arch/x86/traps.c	Thu Nov 25 18:11:19 2004 +0000
     2.2 +++ b/xen/arch/x86/traps.c	Thu Nov 25 18:12:31 2004 +0000
     2.3 @@ -386,11 +386,11 @@ asmlinkage int do_page_fault(struct xen_
     2.4  
     2.5      if ( likely(VM_ASSIST(d, VMASST_TYPE_writable_pagetables)) )
     2.6      {
     2.7 +        LOCK_BIGLOCK(d);
     2.8          if ( unlikely(ptwr_info[cpu].ptinfo[PTWR_PT_ACTIVE].l1va) &&
     2.9               unlikely((addr >> L2_PAGETABLE_SHIFT) ==
    2.10                        ptwr_info[cpu].ptinfo[PTWR_PT_ACTIVE].l2_idx) )
    2.11          {
    2.12 -            LOCK_BIGLOCK(d);
    2.13              ptwr_flush(PTWR_PT_ACTIVE);
    2.14              UNLOCK_BIGLOCK(d);
    2.15              return EXCRET_fault_fixed;
    2.16 @@ -402,8 +402,10 @@ asmlinkage int do_page_fault(struct xen_
    2.17          {
    2.18              if ( unlikely(ed->mm.shadow_mode) )
    2.19                  (void)shadow_fault(addr, regs->error_code);
    2.20 +            UNLOCK_BIGLOCK(d);
    2.21              return EXCRET_fault_fixed;
    2.22          }
    2.23 +        UNLOCK_BIGLOCK(d);
    2.24      }
    2.25  
    2.26      if ( unlikely(ed->mm.shadow_mode) &&