direct-io.hg

changeset 9388:212eb6a2d8cd

[IA64] cleanup of tlb.c

#if 0 unused code for tlb management.

Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
author awilliam@xenbuild.aw
date Tue Mar 21 09:55:04 2006 -0700 (2006-03-21)
parents d18f8fd07fa2
children f163677f8767
files xen/arch/ia64/linux-xen/setup.c xen/arch/ia64/linux-xen/smp.c xen/arch/ia64/linux-xen/tlb.c xen/include/asm-ia64/linux-xen/asm/tlbflush.h
line diff
     1.1 --- a/xen/arch/ia64/linux-xen/setup.c	Tue Mar 21 09:18:28 2006 -0700
     1.2 +++ b/xen/arch/ia64/linux-xen/setup.c	Tue Mar 21 09:55:04 2006 -0700
     1.3 @@ -765,8 +765,10 @@ cpu_init (void)
     1.4  {
     1.5  	extern void __devinit ia64_mmu_init (void *);
     1.6  	unsigned long num_phys_stacked;
     1.7 +#ifndef XEN
     1.8  	pal_vm_info_2_u_t vmi;
     1.9  	unsigned int max_ctx;
    1.10 +#endif
    1.11  	struct cpuinfo_ia64 *cpu_info;
    1.12  	void *cpu_data;
    1.13  
    1.14 @@ -874,6 +876,7 @@ cpu_init (void)
    1.15  	normal_xtp();
    1.16  #endif
    1.17  
    1.18 +#ifndef XEN
    1.19  	/* set ia64_ctx.max_rid to the maximum RID that is supported by all CPUs: */
    1.20  	if (ia64_pal_vm_summary(NULL, &vmi) == 0)
    1.21  		max_ctx = (1U << (vmi.pal_vm_info_2_s.rid_size - 3)) - 1;
    1.22 @@ -886,6 +889,7 @@ cpu_init (void)
    1.23  		if (cmpxchg(&ia64_ctx.max_ctx, old, max_ctx) == old)
    1.24  			break;
    1.25  	}
    1.26 +#endif
    1.27  
    1.28  	if (ia64_pal_rse_info(&num_phys_stacked, NULL) != 0) {
    1.29  		printk(KERN_WARNING "cpu_init: PAL RSE info failed; assuming 96 physical "
     2.1 --- a/xen/arch/ia64/linux-xen/smp.c	Tue Mar 21 09:18:28 2006 -0700
     2.2 +++ b/xen/arch/ia64/linux-xen/smp.c	Tue Mar 21 09:55:04 2006 -0700
     2.3 @@ -291,17 +291,13 @@ smp_flush_tlb_all (void)
     2.4  	on_each_cpu((void (*)(void *))local_flush_tlb_all, NULL, 1, 1);
     2.5  }
     2.6  
     2.7 +#ifndef XEN
     2.8  void
     2.9  smp_flush_tlb_mm (struct mm_struct *mm)
    2.10  {
    2.11  	preempt_disable();
    2.12  	/* this happens for the common case of a single-threaded fork():  */
    2.13 -#ifdef XEN
    2.14 -	if (likely(mm == current->domain->arch.mm
    2.15 -		   && atomic_read(&mm->mm_users) == 1))
    2.16 -#else
    2.17  	if (likely(mm == current->active_mm && atomic_read(&mm->mm_users) == 1))
    2.18 -#endif
    2.19  	{
    2.20  		local_finish_flush_tlb_mm(mm);
    2.21  		preempt_enable();
    2.22 @@ -318,6 +314,7 @@ smp_flush_tlb_mm (struct mm_struct *mm)
    2.23  	 */
    2.24  	on_each_cpu((void (*)(void *))local_finish_flush_tlb_mm, mm, 1, 1);
    2.25  }
    2.26 +#endif
    2.27  
    2.28  /*
    2.29   * Run a function on another CPU
     3.1 --- a/xen/arch/ia64/linux-xen/tlb.c	Tue Mar 21 09:18:28 2006 -0700
     3.2 +++ b/xen/arch/ia64/linux-xen/tlb.c	Tue Mar 21 09:55:04 2006 -0700
     3.3 @@ -28,6 +28,7 @@ static struct {
     3.4  	unsigned long max_bits;	/* log2() of largest supported purge page-size */
     3.5  } purge;
     3.6  
     3.7 +#ifndef XEN
     3.8  struct ia64_ctx ia64_ctx = {
     3.9  	.lock =		SPIN_LOCK_UNLOCKED,
    3.10  	.next =		1,
    3.11 @@ -43,9 +44,6 @@ DEFINE_PER_CPU(u8, ia64_need_tlb_flush);
    3.12  void
    3.13  wrap_mmu_context (struct mm_struct *mm)
    3.14  {
    3.15 -#ifdef XEN
    3.16 -printf("wrap_mmu_context: called, not implemented\n");
    3.17 -#else
    3.18  	unsigned long tsk_context, max_ctx = ia64_ctx.max_ctx;
    3.19  	struct task_struct *tsk;
    3.20  	int i;
    3.21 @@ -86,8 +84,8 @@ printf("wrap_mmu_context: called, not im
    3.22  		put_cpu();
    3.23  	}
    3.24  	local_flush_tlb_all();
    3.25 -#endif
    3.26  }
    3.27 +#endif /* XEN */
    3.28  
    3.29  void
    3.30  ia64_global_tlb_purge (unsigned long start, unsigned long end, unsigned long nbits)
    3.31 @@ -133,12 +131,10 @@ local_flush_tlb_all (void)
    3.32  }
    3.33  EXPORT_SYMBOL(local_flush_tlb_all);
    3.34  
    3.35 +#ifndef XEN
    3.36  void
    3.37  flush_tlb_range (struct vm_area_struct *vma, unsigned long start, unsigned long end)
    3.38  {
    3.39 -#ifdef XEN
    3.40 -printf("flush_tlb_range: called, not implemented\n");
    3.41 -#else
    3.42  	struct mm_struct *mm = vma->vm_mm;
    3.43  	unsigned long size = end - start;
    3.44  	unsigned long nbits;
    3.45 @@ -170,9 +166,9 @@ printf("flush_tlb_range: called, not imp
    3.46  # endif
    3.47  
    3.48  	ia64_srlz_i();			/* srlz.i implies srlz.d */
    3.49 -#endif
    3.50  }
    3.51  EXPORT_SYMBOL(flush_tlb_range);
    3.52 +#endif
    3.53  
    3.54  void __devinit
    3.55  ia64_tlb_init (void)
     4.1 --- a/xen/include/asm-ia64/linux-xen/asm/tlbflush.h	Tue Mar 21 09:18:28 2006 -0700
     4.2 +++ b/xen/include/asm-ia64/linux-xen/asm/tlbflush.h	Tue Mar 21 09:55:04 2006 -0700
     4.3 @@ -33,6 +33,7 @@ extern void local_flush_tlb_all (void);
     4.4  # define flush_tlb_all()	local_flush_tlb_all()
     4.5  #endif
     4.6  
     4.7 +#ifndef XEN
     4.8  static inline void
     4.9  local_finish_flush_tlb_mm (struct mm_struct *mm)
    4.10  {
    4.11 @@ -109,6 +110,8 @@ flush_tlb_pgtables (struct mm_struct *mm
    4.12  
    4.13  
    4.14  #define flush_tlb_kernel_range(start, end)	flush_tlb_all()	/* XXX fix me */
    4.15 +#endif /* XEN */
    4.16 +
    4.17  #ifdef XEN
    4.18  extern void flush_tlb_mask(cpumask_t mask);
    4.19  #endif