ia64/xen-unstable

changeset 10933:6c67ca1e1c1a

[IA64] remove CONFIG_DOMAIN0_CONTIGUOUS and dom0_start

Remove unused build option CONFIG_DOMAIN0_CONTIGUOUS, thereby
making dom0_start obsolete.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
author awilliam@xenbuild.aw
date Tue Aug 08 14:31:48 2006 -0600 (2006-08-08)
parents 571022d5afa2
children 2aaad9cbc926
files xen/arch/ia64/xen/dom_fw.c xen/arch/ia64/xen/domain.c xen/arch/ia64/xen/mm.c xen/include/asm-ia64/config.h
line diff
     1.1 --- a/xen/arch/ia64/xen/dom_fw.c	Mon Aug 07 14:11:58 2006 -0600
     1.2 +++ b/xen/arch/ia64/xen/dom_fw.c	Tue Aug 08 14:31:48 2006 -0600
     1.3 @@ -28,7 +28,6 @@
     1.4  static void dom_fw_init (struct domain *d, struct ia64_boot_param *bp, char *fw_mem, int fw_mem_size, unsigned long maxmem);
     1.5  
     1.6  extern struct domain *dom0;
     1.7 -extern unsigned long dom0_start;
     1.8  
     1.9  extern unsigned long running_on_sim;
    1.10  
     2.1 --- a/xen/arch/ia64/xen/domain.c	Mon Aug 07 14:11:58 2006 -0600
     2.2 +++ b/xen/arch/ia64/xen/domain.c	Tue Aug 08 14:31:48 2006 -0600
     2.3 @@ -49,7 +49,6 @@
     2.4  #include <asm/shadow.h>
     2.5  #include <asm/privop_stat.h>
     2.6  
     2.7 -unsigned long dom0_start = -1L;
     2.8  unsigned long dom0_size = 512*1024*1024;
     2.9  unsigned long dom0_align = 64*1024*1024;
    2.10  
    2.11 @@ -782,24 +781,6 @@ static void loaddomainelfimage(struct do
    2.12  		elfaddr = (unsigned long) elfbase + phdr.p_offset;
    2.13  		dom_mpaddr = phdr.p_paddr;
    2.14  
    2.15 -//printf("p_offset: %x, size=%x\n",elfaddr,filesz);
    2.16 -#ifdef CONFIG_DOMAIN0_CONTIGUOUS
    2.17 -		if (d == dom0) {
    2.18 -			if (dom_mpaddr+memsz>dom0_size)
    2.19 -				panic("Dom0 doesn't fit in memory space!\n");
    2.20 -			dom_imva = __va_ul(dom_mpaddr + dom0_start);
    2.21 -			memcpy((void *)dom_imva, (void *)elfaddr, filesz);
    2.22 -			if (memsz > filesz)
    2.23 -				memset((void *)dom_imva+filesz, 0,
    2.24 -				       memsz-filesz);
    2.25 -//FIXME: This test for code seems to find a lot more than objdump -x does
    2.26 -			if (phdr.p_flags & PF_X) {
    2.27 -				privify_memory(dom_imva,filesz);
    2.28 -				flush_icache_range (dom_imva, dom_imva+filesz);
    2.29 -			}
    2.30 -		}
    2.31 -		else
    2.32 -#endif
    2.33  		while (memsz > 0) {
    2.34  			p = assign_new_domain_page(d,dom_mpaddr);
    2.35  			BUG_ON (unlikely(p == NULL));
    2.36 @@ -864,27 +845,10 @@ void alloc_dom0(void)
    2.37  	if (running_on_sim) {
    2.38  		dom0_size = 128*1024*1024; //FIXME: Should be configurable
    2.39  	}
    2.40 -#ifdef CONFIG_DOMAIN0_CONTIGUOUS
    2.41 -	printf("alloc_dom0: starting (initializing %lu MB...)\n",dom0_size/(1024*1024));
    2.42 - 
    2.43 -	/* FIXME: The first trunk (say 256M) should always be assigned to
    2.44 -	 * Dom0, since Dom0's physical == machine address for DMA purpose.
    2.45 -	 * Some old version linux, like 2.4, assumes physical memory existing
    2.46 -	 * in 2nd 64M space.
    2.47 +
    2.48 +	/* no need to allocate pages for now
    2.49 +	 * pages are allocated by map_new_domain_page() via loaddomainelfimage()
    2.50  	 */
    2.51 -	dom0_start = alloc_boot_pages(dom0_size >> PAGE_SHIFT, dom0_align >> PAGE_SHIFT);
    2.52 -	dom0_start <<= PAGE_SHIFT;
    2.53 -	if (!dom0_start) {
    2.54 -	  panic("alloc_dom0: can't allocate contiguous memory size=%lu\n",
    2.55 -		dom0_size);
    2.56 -	}
    2.57 -	printf("alloc_dom0: dom0_start=0x%lx\n", dom0_start);
    2.58 -#else
    2.59 -	// no need to allocate pages for now
    2.60 -	// pages are allocated by map_new_domain_page() via loaddomainelfimage()
    2.61 -	dom0_start = 0;
    2.62 -#endif
    2.63 -
    2.64  }
    2.65  
    2.66  
    2.67 @@ -910,7 +874,6 @@ int construct_dom0(struct domain *d,
    2.68  	               char *cmdline)
    2.69  {
    2.70  	int i, rc;
    2.71 -	unsigned long alloc_start, alloc_end;
    2.72  	start_info_t *si;
    2.73  	struct vcpu *v = d->vcpu[0];
    2.74  	unsigned long max_pages;
    2.75 @@ -943,8 +906,6 @@ int construct_dom0(struct domain *d,
    2.76  
    2.77  	printk("*** LOADING DOMAIN 0 ***\n");
    2.78  
    2.79 -	alloc_start = dom0_start;
    2.80 -	alloc_end = dom0_start + dom0_size;
    2.81  	max_pages = dom0_size / PAGE_SIZE;
    2.82  	d->max_pages = max_pages;
    2.83  	d->tot_pages = 0;
    2.84 @@ -988,8 +949,7 @@ int construct_dom0(struct domain *d,
    2.85  	if(initrd_start && initrd_len){
    2.86  	    unsigned long offset;
    2.87  
    2.88 -	    pinitrd_start= (dom0_start + dom0_size) -
    2.89 -	                   (PAGE_ALIGN(initrd_len) + 4*1024*1024);
    2.90 +	    pinitrd_start= dom0_size - (PAGE_ALIGN(initrd_len) + 4*1024*1024);
    2.91  	    if (pinitrd_start <= pstart_info)
    2.92  		panic("%s:enough memory is not assigned to dom0", __func__);
    2.93  
    2.94 @@ -1095,17 +1055,14 @@ int construct_dom0(struct domain *d,
    2.95  	bp->console_info.orig_y = bp->console_info.num_rows == 0 ?
    2.96  	                          0 : bp->console_info.num_rows - 1;
    2.97  
    2.98 -	bp->initrd_start = (dom0_start+dom0_size) -
    2.99 -	  (PAGE_ALIGN(ia64_boot_param->initrd_size) + 4*1024*1024);
   2.100 +	bp->initrd_start = dom0_size -
   2.101 +	             (PAGE_ALIGN(ia64_boot_param->initrd_size) + 4*1024*1024);
   2.102  	bp->initrd_size = ia64_boot_param->initrd_size;
   2.103  
   2.104  	vcpu_init_regs (v);
   2.105  
   2.106  	vcpu_regs(v)->r28 = bp_mpa;
   2.107  
   2.108 -#ifdef CONFIG_DOMAIN0_CONTIGUOUS
   2.109 -	pkern_entry += dom0_start;
   2.110 -#endif
   2.111  	vcpu_regs (v)->cr_iip = pkern_entry;
   2.112  
   2.113  	physdev_init_dom0(d);
     3.1 --- a/xen/arch/ia64/xen/mm.c	Mon Aug 07 14:11:58 2006 -0600
     3.2 +++ b/xen/arch/ia64/xen/mm.c	Tue Aug 08 14:31:48 2006 -0600
     3.3 @@ -648,21 +648,8 @@ unsigned long
     3.4  unsigned long lookup_domain_mpa(struct domain *d, unsigned long mpaddr,
     3.5                                  struct p2m_entry* entry)
     3.6  {
     3.7 -    volatile pte_t *pte;
     3.8 +    volatile pte_t *pte = lookup_noalloc_domain_pte(d, mpaddr);
     3.9  
    3.10 -#ifdef CONFIG_DOMAIN0_CONTIGUOUS
    3.11 -    if (d == dom0) {
    3.12 -        pte_t pteval;
    3.13 -        if (mpaddr < dom0_start || mpaddr >= dom0_start + dom0_size) {
    3.14 -            //printk("lookup_domain_mpa: bad dom0 mpaddr 0x%lx!\n",mpaddr);
    3.15 -            //printk("lookup_domain_mpa: start=0x%lx,end=0x%lx!\n",dom0_start,dom0_start+dom0_size);
    3.16 -        }
    3.17 -        pteval = pfn_pte(mpaddr >> PAGE_SHIFT,
    3.18 -            __pgprot(__DIRTY_BITS | _PAGE_PL_2 | _PAGE_AR_RWX));
    3.19 -        return pte_val(pteval);
    3.20 -    }
    3.21 -#endif
    3.22 -    pte = lookup_noalloc_domain_pte(d, mpaddr);
    3.23      if (pte != NULL) {
    3.24          pte_t tmp_pte = *pte;// pte is volatile. copy the value.
    3.25          if (pte_present(tmp_pte)) {
    3.26 @@ -716,28 +703,12 @@ void *domain_mpa_to_imva(struct domain *
    3.27  static struct page_info *
    3.28  __assign_new_domain_page(struct domain *d, unsigned long mpaddr, pte_t* pte)
    3.29  {
    3.30 -    struct page_info *p = NULL;
    3.31 +    struct page_info *p;
    3.32      unsigned long maddr;
    3.33      int ret;
    3.34  
    3.35      BUG_ON(!pte_none(*pte));
    3.36  
    3.37 -#ifdef CONFIG_DOMAIN0_CONTIGUOUS
    3.38 -    if (d == dom0) {
    3.39 -#if 0
    3.40 -        if (mpaddr < dom0_start || mpaddr >= dom0_start + dom0_size) {
    3.41 -            /* FIXME: is it true ?
    3.42 -               dom0 memory is not contiguous!  */
    3.43 -            panic("assign_new_domain_page: bad domain0 "
    3.44 -                  "mpaddr=%lx, start=%lx, end=%lx!\n",
    3.45 -                  mpaddr, dom0_start, dom0_start+dom0_size);
    3.46 -        }
    3.47 -#endif
    3.48 -        p = mfn_to_page((mpaddr >> PAGE_SHIFT));
    3.49 -        return p;
    3.50 -    }
    3.51 -#endif
    3.52 -
    3.53      p = alloc_domheap_page(d);
    3.54      if (unlikely(!p)) {
    3.55          printf("assign_new_domain_page: Can't alloc!!!! Aaaargh!\n");
    3.56 @@ -771,25 +742,17 @@ static struct page_info *
    3.57  struct page_info *
    3.58  assign_new_domain_page(struct domain *d, unsigned long mpaddr)
    3.59  {
    3.60 -#ifdef CONFIG_DOMAIN0_CONTIGUOUS
    3.61 -    pte_t dummy_pte = __pte(0);
    3.62 -    return __assign_new_domain_page(d, mpaddr, &dummy_pte);
    3.63 -#else
    3.64 -    struct page_info *p = NULL;
    3.65 -    pte_t *pte;
    3.66 +    pte_t *pte = __lookup_alloc_domain_pte(d, mpaddr);
    3.67  
    3.68 -    pte = __lookup_alloc_domain_pte(d, mpaddr);
    3.69 -    if (pte_none(*pte))
    3.70 -        p = __assign_new_domain_page(d, mpaddr, pte);
    3.71 +    if (!pte_none(*pte))
    3.72 +        return NULL;
    3.73  
    3.74 -    return p;
    3.75 -#endif
    3.76 +    return __assign_new_domain_page(d, mpaddr, pte);
    3.77  }
    3.78  
    3.79  void
    3.80  assign_new_domain0_page(struct domain *d, unsigned long mpaddr)
    3.81  {
    3.82 -#ifndef CONFIG_DOMAIN0_CONTIGUOUS
    3.83      pte_t *pte;
    3.84  
    3.85      BUG_ON(d != dom0);
    3.86 @@ -800,7 +763,6 @@ assign_new_domain0_page(struct domain *d
    3.87              panic("%s: can't allocate page for dom0", __func__);
    3.88          }
    3.89      }
    3.90 -#endif
    3.91  }
    3.92  
    3.93  static unsigned long
    3.94 @@ -1538,15 +1500,6 @@ void domain_cache_flush (struct domain *
    3.95      else
    3.96          flush_func = &flush_dcache_range;
    3.97  
    3.98 -#ifdef CONFIG_DOMAIN0_CONTIGUOUS
    3.99 -    if (d == dom0) {
   3.100 -        /* This is not fully correct (because of hole), but it should
   3.101 -           be enough for now.  */
   3.102 -        (*flush_func)(__va_ul (dom0_start),
   3.103 -                  __va_ul (dom0_start + dom0_size));
   3.104 -        return;
   3.105 -    }
   3.106 -#endif
   3.107      for (i = 0; i < PTRS_PER_PGD; pgd++, i++) {
   3.108          pud_t *pud;
   3.109          if (!pgd_present(*pgd))
     4.1 --- a/xen/include/asm-ia64/config.h	Mon Aug 07 14:11:58 2006 -0600
     4.2 +++ b/xen/include/asm-ia64/config.h	Tue Aug 08 14:31:48 2006 -0600
     4.3 @@ -66,7 +66,6 @@ extern unsigned long xenheap_phys_end;
     4.4  extern unsigned long xen_pstart;
     4.5  extern unsigned long xenheap_size;
     4.6  //extern struct domain *dom0;
     4.7 -extern unsigned long dom0_start;
     4.8  extern unsigned long dom0_size;
     4.9  
    4.10  // from linux/include/linux/mm.h