ia64/xen-unstable

changeset 9853:fcfc614d3713

[IA64] cleanup

Cleanup: add static, remove unused code/variables/macros.
Simplifications.

Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
author awilliam@xenbuild.aw
date Wed Apr 26 12:44:45 2006 -0600 (2006-04-26)
parents e8383c2fcd50
children 4174856876f9
files xen/arch/ia64/linux-xen/smp.c xen/arch/ia64/xen/domain.c xen/arch/ia64/xen/regionreg.c xen/arch/ia64/xen/xenmem.c xen/arch/ia64/xen/xenmisc.c xen/include/asm-ia64/flushtlb.h xen/include/asm-ia64/vhpt.h
line diff
     1.1 --- a/xen/arch/ia64/linux-xen/smp.c	Wed Apr 26 12:40:56 2006 -0600
     1.2 +++ b/xen/arch/ia64/linux-xen/smp.c	Wed Apr 26 12:44:45 2006 -0600
     1.3 @@ -57,7 +57,6 @@
     1.4  //Huh? This seems to be used on ia64 even if !CONFIG_SMP
     1.5  void flush_tlb_mask(cpumask_t mask)
     1.6  {
     1.7 -#ifdef CONFIG_SMP
     1.8      int cpu;
     1.9  
    1.10      cpu = smp_processor_id();
    1.11 @@ -66,6 +65,7 @@ void flush_tlb_mask(cpumask_t mask)
    1.12  	local_flush_tlb_all ();
    1.13      }
    1.14  
    1.15 +#ifdef CONFIG_SMP
    1.16      if (cpus_empty(mask))
    1.17          return;
    1.18  
    1.19 @@ -93,14 +93,6 @@ void smp_send_event_check_mask(cpumask_t
    1.20          if (cpu_isset(cpu, mask))
    1.21  	    platform_send_ipi(cpu, IA64_IPI_RESCHEDULE, IA64_IPI_DM_INT, 0);
    1.22  }
    1.23 -
    1.24 -
    1.25 -//Huh? This seems to be used on ia64 even if !CONFIG_SMP
    1.26 -int try_flush_tlb_mask(cpumask_t mask)
    1.27 -{
    1.28 -	dummy();
    1.29 -	return 1;
    1.30 -}
    1.31  #endif
    1.32  #endif
    1.33  
     2.1 --- a/xen/arch/ia64/xen/domain.c	Wed Apr 26 12:40:56 2006 -0600
     2.2 +++ b/xen/arch/ia64/xen/domain.c	Wed Apr 26 12:44:45 2006 -0600
     2.3 @@ -598,14 +598,13 @@ struct page_info *
     2.4          p = mfn_to_page((mpaddr >> PAGE_SHIFT));
     2.5          return p;
     2.6      }
     2.7 -    else
     2.8  #endif
     2.9 -    {
    2.10 -        p = alloc_domheap_page(d);
    2.11 -        // zero out pages for security reasons
    2.12 -        if (p)
    2.13 -            clear_page(page_to_virt(p));
    2.14 -    }
    2.15 +
    2.16 +    p = alloc_domheap_page(d);
    2.17 +    // zero out pages for security reasons
    2.18 +    if (p)
    2.19 +        clear_page(page_to_virt(p));
    2.20 +
    2.21      if (unlikely(!p)) {
    2.22          printf("assign_new_domain_page: Can't alloc!!!! Aaaargh!\n");
    2.23          return(p);
     3.1 --- a/xen/arch/ia64/xen/regionreg.c	Wed Apr 26 12:40:56 2006 -0600
     3.2 +++ b/xen/arch/ia64/xen/regionreg.c	Wed Apr 26 12:44:45 2006 -0600
     3.3 @@ -250,25 +250,6 @@ int set_one_rr(unsigned long rr, unsigne
     3.4  		return 0;
     3.5  	}
     3.6  
     3.7 -#if 0
     3.8 -	memrrv.rrval = rrv.rrval;
     3.9 -	if (rreg == 7) {
    3.10 -		newrrv.rid = newrid;
    3.11 -		newrrv.ve = VHPT_ENABLED_REGION_7;
    3.12 -		newrrv.ps = IA64_GRANULE_SHIFT;
    3.13 -		ia64_new_rr7(vmMangleRID(newrrv.rrval),v->vcpu_info,
    3.14 -				v->arch.privregs);
    3.15 -	}
    3.16 -	else {
    3.17 -		newrrv.rid = newrid;
    3.18 -		// FIXME? region 6 needs to be uncached for EFI to work
    3.19 -		if (rreg == 6) newrrv.ve = VHPT_ENABLED_REGION_7;
    3.20 -		else newrrv.ve = VHPT_ENABLED_REGION_0_TO_6;
    3.21 -		newrrv.ps = PAGE_SHIFT;
    3.22 -		if (rreg == 0) v->arch.metaphysical_saved_rr0 = newrrv.rrval;
    3.23 -		set_rr(rr,newrrv.rrval);
    3.24 -	}
    3.25 -#else
    3.26  	memrrv.rrval = rrv.rrval;
    3.27  	newrrv.rid = newrid;
    3.28  	newrrv.ve = 1;  // VHPT now enabled for region 7!!
    3.29 @@ -285,7 +266,6 @@ int set_one_rr(unsigned long rr, unsigne
    3.30  	} else {
    3.31  		set_rr(rr,newrrv.rrval);
    3.32  	}
    3.33 -#endif
    3.34  	return 1;
    3.35  }
    3.36  
     4.1 --- a/xen/arch/ia64/xen/xenmem.c	Wed Apr 26 12:40:56 2006 -0600
     4.2 +++ b/xen/arch/ia64/xen/xenmem.c	Wed Apr 26 12:44:45 2006 -0600
     4.3 @@ -100,7 +100,7 @@ alloc_table_page(unsigned long fill)
     4.4  	return mfn;
     4.5  }
     4.6  
     4.7 -int
     4.8 +static int
     4.9  create_frametable_page_table (u64 start, u64 end, void *arg)
    4.10  {
    4.11  	unsigned long address, start_page, end_page;
    4.12 @@ -136,7 +136,7 @@ create_frametable_page_table (u64 start,
    4.13  	return 0;
    4.14  }
    4.15  
    4.16 -int
    4.17 +static int
    4.18  create_mpttable_page_table (u64 start, u64 end, void *arg)
    4.19  {
    4.20  	unsigned long address, start_page, end_page;
     5.1 --- a/xen/arch/ia64/xen/xenmisc.c	Wed Apr 26 12:40:56 2006 -0600
     5.2 +++ b/xen/arch/ia64/xen/xenmisc.c	Wed Apr 26 12:44:45 2006 -0600
     5.3 @@ -69,21 +69,19 @@ struct pt_regs *guest_cpu_user_regs(void
     5.4  unsigned long
     5.5  gmfn_to_mfn_foreign(struct domain *d, unsigned long gpfn)
     5.6  {
     5.7 +	unsigned long pte;
     5.8 +
     5.9  #ifndef CONFIG_XEN_IA64_DOM0_VP
    5.10  	if (d == dom0)
    5.11  		return(gpfn);
    5.12 -	else
    5.13  #endif
    5.14 -	{
    5.15 -		unsigned long pte = lookup_domain_mpa(d,gpfn << PAGE_SHIFT);
    5.16 -		if (!pte) {
    5.17 -printk("gmfn_to_mfn_foreign: bad gpfn. spinning...\n");
    5.18 -while(1);
    5.19 -			return 0;
    5.20 -		}
    5.21 -		return ((pte & _PFN_MASK) >> PAGE_SHIFT);
    5.22 +	pte = lookup_domain_mpa(d,gpfn << PAGE_SHIFT);
    5.23 +	if (!pte) {
    5.24 +		panic("gmfn_to_mfn_foreign: bad gpfn. spinning...\n");
    5.25  	}
    5.26 +	return ((pte & _PFN_MASK) >> PAGE_SHIFT);
    5.27  }
    5.28 +
    5.29  #if 0
    5.30  u32
    5.31  mfn_to_gmfn(struct domain *d, unsigned long frame)
    5.32 @@ -98,13 +96,6 @@ while(1);
    5.33  #endif
    5.34  
    5.35  ///////////////////////////////
    5.36 -// from arch/x86/flushtlb.c
    5.37 -///////////////////////////////
    5.38 -
    5.39 -u32 tlbflush_clock;
    5.40 -u32 tlbflush_time[NR_CPUS];
    5.41 -
    5.42 -///////////////////////////////
    5.43  // from arch/x86/memory.c
    5.44  ///////////////////////////////
    5.45  
    5.46 @@ -287,8 +278,8 @@ void context_switch(struct vcpu *prev, s
    5.47  static long cnt[16] = { 50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50};
    5.48  static int i = 100;
    5.49  int id = ((struct vcpu *)current)->domain->domain_id & 0xf;
    5.50 -if (!cnt[id]--) { printk("%x",id); cnt[id] = 500000; }
    5.51 -if (!i--) { printk("+"); i = 1000000; }
    5.52 +if (!cnt[id]--) { cnt[id] = 500000; printk("%x",id); }
    5.53 +if (!i--) { i = 1000000; printk("+"); }
    5.54  }
    5.55  
    5.56      if (VMX_DOMAIN(current)){
     6.1 --- a/xen/include/asm-ia64/flushtlb.h	Wed Apr 26 12:40:56 2006 -0600
     6.2 +++ b/xen/include/asm-ia64/flushtlb.h	Wed Apr 26 12:44:45 2006 -0600
     6.3 @@ -3,14 +3,7 @@
     6.4  
     6.5  #include <asm/tlbflush.h>
     6.6  
     6.7 -/* The current time as shown by the virtual TLB clock. */
     6.8 -extern u32 tlbflush_clock;
     6.9 -
    6.10 -/* Time at which each CPU's TLB was last flushed. */
    6.11 -extern u32 tlbflush_time[NR_CPUS];
    6.12 -
    6.13 -#define tlbflush_current_time() tlbflush_clock
    6.14 +#define tlbflush_current_time() 0
    6.15  #define tlbflush_filter(x,y) ((void)0)
    6.16 -#define NEED_FLUSH(x, y) (0)
    6.17  
    6.18  #endif
     7.1 --- a/xen/include/asm-ia64/vhpt.h	Wed Apr 26 12:40:56 2006 -0600
     7.2 +++ b/xen/include/asm-ia64/vhpt.h	Wed Apr 26 12:44:45 2006 -0600
     7.3 @@ -2,8 +2,6 @@
     7.4  #define ASM_VHPT_H
     7.5  
     7.6  #define VHPT_ENABLED 1
     7.7 -#define VHPT_ENABLED_REGION_0_TO_6 1
     7.8 -#define VHPT_ENABLED_REGION_7 0
     7.9  
    7.10  /* Size of the VHPT.  */
    7.11  #define	VHPT_SIZE_LOG2			24