ia64/xen-unstable

changeset 4193:e4eded7d65dd

bitkeeper revision 1.1236.34.12 (42398f7asEUKTar-hO4ZiDXWYTpyiA)

Some small header-include cleanups. No need for BIGLOCK in dom_mem_op
hypercall.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Thu Mar 17 14:08:58 2005 +0000 (2005-03-17)
parents 77fce201bf8b
children fe8583803c7d
files xen/arch/x86/smp.c xen/arch/x86/x86_emulate.c xen/common/dom_mem_ops.c xen/common/elf.c xen/common/page_alloc.c xen/common/xmalloc.c xen/include/asm-x86/mm.h xen/include/xen/sched.h
line diff
     1.1 --- a/xen/arch/x86/smp.c	Wed Mar 16 10:05:37 2005 +0000
     1.2 +++ b/xen/arch/x86/smp.c	Thu Mar 17 14:08:58 2005 +0000
     1.3 @@ -8,9 +8,11 @@
     1.4   *	later.
     1.5   */
     1.6  
     1.7 +#include <xen/config.h>
     1.8  #include <xen/irq.h>
     1.9  #include <xen/sched.h>
    1.10  #include <xen/delay.h>
    1.11 +#include <xen/perfc.h>
    1.12  #include <xen/spinlock.h>
    1.13  #include <asm/smp.h>
    1.14  #include <asm/mc146818rtc.h>
    1.15 @@ -18,8 +20,6 @@
    1.16  #include <asm/smpboot.h>
    1.17  #include <asm/hardirq.h>
    1.18  
    1.19 -#ifdef CONFIG_SMP
    1.20 -
    1.21  /*
    1.22   *	Some notes on x86 processor bugs affecting SMP operation:
    1.23   *
    1.24 @@ -420,5 +420,3 @@ asmlinkage void smp_call_function_interr
    1.25          atomic_inc(&call_data->finished);
    1.26      }
    1.27  }
    1.28 -
    1.29 -#endif /* CONFIG_SMP */
     2.1 --- a/xen/arch/x86/x86_emulate.c	Wed Mar 16 10:05:37 2005 +0000
     2.2 +++ b/xen/arch/x86/x86_emulate.c	Thu Mar 17 14:08:58 2005 +0000
     2.3 @@ -22,6 +22,7 @@ typedef int64_t            s64;
     2.4  #include <xen/config.h>
     2.5  #include <xen/types.h>
     2.6  #include <xen/lib.h>
     2.7 +#include <xen/mm.h>
     2.8  #include <asm/regs.h>
     2.9  #endif
    2.10  #include <asm-x86/x86_emulate.h>
     3.1 --- a/xen/common/dom_mem_ops.c	Wed Mar 16 10:05:37 2005 +0000
     3.2 +++ b/xen/common/dom_mem_ops.c	Thu Mar 17 14:08:58 2005 +0000
     3.3 @@ -142,8 +142,6 @@ do_dom_mem_op(unsigned long  op,
     3.4      else if ( unlikely((d = find_domain_by_id(domid)) == NULL) )
     3.5          return -ESRCH;
     3.6  
     3.7 -    LOCK_BIGLOCK(d);
     3.8 -
     3.9      switch ( op )
    3.10      {
    3.11      case MEMOP_increase_reservation:
    3.12 @@ -162,8 +160,6 @@ do_dom_mem_op(unsigned long  op,
    3.13      if ( unlikely(domid != DOMID_SELF) )
    3.14          put_domain(d);
    3.15  
    3.16 -    UNLOCK_BIGLOCK(d);
    3.17 -
    3.18      return rc;
    3.19  }
    3.20  
     4.1 --- a/xen/common/elf.c	Wed Mar 16 10:05:37 2005 +0000
     4.2 +++ b/xen/common/elf.c	Thu Mar 17 14:08:58 2005 +0000
     4.3 @@ -9,6 +9,7 @@
     4.4  #include <xen/lib.h>
     4.5  #include <xen/mm.h>
     4.6  #include <xen/elf.h>
     4.7 +#include <xen/sched.h>
     4.8  
     4.9  #ifdef CONFIG_X86
    4.10  #define FORCE_XENELF_IMAGE 1
     5.1 --- a/xen/common/page_alloc.c	Wed Mar 16 10:05:37 2005 +0000
     5.2 +++ b/xen/common/page_alloc.c	Thu Mar 17 14:08:58 2005 +0000
     5.3 @@ -24,11 +24,12 @@
     5.4  #include <xen/init.h>
     5.5  #include <xen/types.h>
     5.6  #include <xen/lib.h>
     5.7 -#include <asm/page.h>
     5.8 +#include <xen/perfc.h>
     5.9  #include <xen/spinlock.h>
    5.10  #include <xen/slab.h>
    5.11  #include <xen/irq.h>
    5.12  #include <asm/domain_page.h>
    5.13 +#include <asm/page.h>
    5.14  
    5.15  /*
    5.16   * Comma-separated list of hexadecimal page numbers containing bad bytes.
     6.1 --- a/xen/common/xmalloc.c	Wed Mar 16 10:05:37 2005 +0000
     6.2 +++ b/xen/common/xmalloc.c	Thu Mar 17 14:08:58 2005 +0000
     6.3 @@ -27,10 +27,12 @@
     6.4   *     (Disadvantage is potentially greater internal fragmentation).
     6.5   */
     6.6  
     6.7 +#include <xen/config.h>
     6.8  #include <xen/mm.h>
     6.9  #include <xen/spinlock.h>
    6.10  #include <xen/ac_timer.h>
    6.11  #include <xen/cache.h>
    6.12 +#include <xen/prefetch.h>
    6.13  
    6.14  static LIST_HEAD(freelist);
    6.15  static spinlock_t freelist_lock = SPIN_LOCK_UNLOCKED;
     7.1 --- a/xen/include/asm-x86/mm.h	Wed Mar 16 10:05:37 2005 +0000
     7.2 +++ b/xen/include/asm-x86/mm.h	Thu Mar 17 14:08:58 2005 +0000
     7.3 @@ -4,18 +4,7 @@
     7.4  
     7.5  #include <xen/config.h>
     7.6  #include <xen/list.h>
     7.7 -#include <xen/spinlock.h>
     7.8 -#include <xen/perfc.h>
     7.9 -#include <xen/sched.h>
    7.10 -
    7.11 -#include <asm/processor.h>
    7.12 -#include <asm/atomic.h>
    7.13 -#include <asm/desc.h>
    7.14 -#include <asm/flushtlb.h>
    7.15  #include <asm/io.h>
    7.16 -#include <asm/uaccess.h>
    7.17 -
    7.18 -#include <public/xen.h>
    7.19  
    7.20  /*
    7.21   * Per-page-frame information.
    7.22 @@ -241,19 +230,11 @@ void synchronise_pagetables(unsigned lon
    7.23   */
    7.24  #define __phys_to_machine_mapping ((unsigned long *)RO_MPT_VIRT_START)
    7.25  
    7.26 -/* Returns the machine physical */
    7.27 -static inline unsigned long phys_to_machine_mapping(unsigned long pfn) 
    7.28 -{
    7.29 -    unsigned long mfn;
    7.30 -    l1_pgentry_t pte;
    7.31 -
    7.32 -   if (__get_user(l1_pgentry_val(pte), (__phys_to_machine_mapping + pfn)))
    7.33 -       mfn = 0;
    7.34 -   else
    7.35 -       mfn = l1_pgentry_to_phys(pte) >> PAGE_SHIFT;
    7.36 -
    7.37 -   return mfn; 
    7.38 -}
    7.39 +#define phys_to_machine_mapping(_pfn)                                      \
    7.40 +({ l1_pgentry_t l1e; unsigned long mfn;                                    \
    7.41 +   mfn = __get_user(l1_pgentry_val(l1e), &__phys_to_machine_mapping[_pfn]) \
    7.42 +       ? 0 : l1_pgentry_to_pfn(l1e);                                       \
    7.43 +   mfn; })
    7.44  #define set_machinetophys(_mfn, _pfn) machine_to_phys_mapping[(_mfn)] = (_pfn)
    7.45  
    7.46  #define DEFAULT_GDT_ENTRIES     (LAST_RESERVED_GDT_ENTRY+1)
    7.47 @@ -339,9 +320,10 @@ void audit_domains(void);
    7.48  
    7.49  void propagate_page_fault(unsigned long addr, u16 error_code);
    7.50  
    7.51 -/* update_grant_va_mapping
    7.52 - * Caller must own d's BIGLOCK, is responsible for flushing the TLB,
    7.53 - * and have already get_page'd */
    7.54 +/*
    7.55 + * Caller must own d's BIGLOCK, is responsible for flushing the TLB, and must 
    7.56 + * hold a reference to the page.
    7.57 + */
    7.58  int update_grant_va_mapping(unsigned long va,
    7.59                              unsigned long val,
    7.60                              struct domain *d,
     8.1 --- a/xen/include/xen/sched.h	Wed Mar 16 10:05:37 2005 +0000
     8.2 +++ b/xen/include/xen/sched.h	Thu Mar 17 14:08:58 2005 +0000
     8.3 @@ -89,19 +89,9 @@ struct exec_domain
     8.4      struct arch_exec_domain arch;
     8.5  };
     8.6  
     8.7 -/*
     8.8 -** SMH: do_mmu_update() grabs big_lock and subsequently can fault 
     8.9 -** on map_ldt_shadow_page(), enter do_page_fault() and then deadlock 
    8.10 -** trying to reacquire big_lock. A temporary fix is to make big_lock
    8.11 -** recursive; overall probably needs more thought. 
    8.12 -*/
    8.13 -#if 0
    8.14 -#define LOCK_BIGLOCK(_d) spin_lock(&(_d)->big_lock)
    8.15 -#define UNLOCK_BIGLOCK(_d) spin_unlock(&(_d)->big_lock)
    8.16 -#else
    8.17 +/* Per-domain lock can be recursively acquired in fault handlers. */
    8.18  #define LOCK_BIGLOCK(_d) spin_lock_recursive(&(_d)->big_lock)
    8.19  #define UNLOCK_BIGLOCK(_d) spin_unlock_recursive(&(_d)->big_lock)
    8.20 -#endif
    8.21  
    8.22  struct domain
    8.23  {