ia64/xen-unstable

changeset 8781:6526a91d5555

[IA64] take start_info page from dom0 page not from xen heap.

start_info page is used for xen to pass start up information
to domain0 and the page is used only by dom0 so that it should
belong to dom0.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author awilliam@xenbuild.aw
date Thu Feb 09 13:55:03 2006 -0700 (2006-02-09)
parents ecc8595f2c0b
children dfdb9cfc8b79
files linux-2.6-xen-sparse/arch/ia64/kernel/setup.c xen/arch/ia64/xen/domain.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/ia64/kernel/setup.c	Thu Feb 09 13:48:05 2006 -0700
     1.2 +++ b/linux-2.6-xen-sparse/arch/ia64/kernel/setup.c	Thu Feb 09 13:55:03 2006 -0700
     1.3 @@ -61,6 +61,9 @@
     1.4  #include <asm/system.h>
     1.5  #include <asm/unistd.h>
     1.6  #include <asm/system.h>
     1.7 +#ifdef CONFIG_XEN
     1.8 +#include <asm/hypervisor.h>
     1.9 +#endif
    1.10  
    1.11  #if defined(CONFIG_SMP) && (IA64_CPU_SIZE > PAGE_SIZE)
    1.12  # error "struct cpuinfo_ia64 too big!"
    1.13 @@ -241,6 +244,12 @@ reserve_memory (void)
    1.14  	rsvd_region[n].end   = (unsigned long) ia64_imva(_end);
    1.15  	n++;
    1.16  
    1.17 +#ifdef CONFIG_XEN
    1.18 +	rsvd_region[n].start = (unsigned long) (HYPERVISOR_shared_info->arch.start_info_pfn << PAGE_SHIFT);
    1.19 +	rsvd_region[n].end   = rsvd_region[n].start + PAGE_SIZE;
    1.20 +	n++;
    1.21 +#endif
    1.22 +
    1.23  #ifdef CONFIG_BLK_DEV_INITRD
    1.24  	if (ia64_boot_param->initrd_start) {
    1.25  		rsvd_region[n].start = (unsigned long)__va(ia64_boot_param->initrd_start);
     2.1 --- a/xen/arch/ia64/xen/domain.c	Thu Feb 09 13:48:05 2006 -0700
     2.2 +++ b/xen/arch/ia64/xen/domain.c	Thu Feb 09 13:55:03 2006 -0700
     2.3 @@ -782,6 +782,7 @@ int construct_dom0(struct domain *d,
     2.4  	unsigned long pkern_entry;
     2.5  	unsigned long pkern_end;
     2.6  	unsigned long pinitrd_start = 0;
     2.7 +	unsigned long pstart_info;
     2.8  	unsigned long ret, progress = 0;
     2.9  
    2.10  //printf("construct_dom0: starting\n");
    2.11 @@ -839,13 +840,18 @@ int construct_dom0(struct domain *d,
    2.12                            (PAGE_ALIGN(initrd_len) + 4*1024*1024);
    2.13  
    2.14               memcpy(__va(pinitrd_start),initrd_start,initrd_len);
    2.15 +             pstart_info = PAGE_ALIGN(pinitrd_start + initrd_len);
    2.16 +        } else {
    2.17 +             pstart_info = PAGE_ALIGN(pkern_end);
    2.18          }
    2.19  
    2.20  	printk("METAPHYSICAL MEMORY ARRANGEMENT:\n"
    2.21  	       " Kernel image:  %lx->%lx\n"
    2.22  	       " Entry address: %lx\n"
    2.23 -               " Init. ramdisk: %lx len %lx\n",
    2.24 -               pkern_start, pkern_end, pkern_entry, pinitrd_start, initrd_len);
    2.25 +	       " Init. ramdisk: %lx len %lx\n"
    2.26 +	       " Start info.:   %lx->%lx\n",
    2.27 +	       pkern_start, pkern_end, pkern_entry, pinitrd_start, initrd_len,
    2.28 +	       pstart_info, pstart_info + PAGE_SIZE);
    2.29  
    2.30  	if ( (pkern_end - pkern_start) > (d->max_pages * PAGE_SIZE) )
    2.31  	{
    2.32 @@ -900,9 +906,9 @@ int construct_dom0(struct domain *d,
    2.33  
    2.34  
    2.35  	/* Set up start info area. */
    2.36 -	si = (start_info_t *)alloc_xenheap_page();
    2.37 +	d->shared_info->arch.start_info_pfn = pstart_info >> PAGE_SHIFT;
    2.38 +	si = __va(pstart_info);
    2.39  	memset(si, 0, PAGE_SIZE);
    2.40 -	d->shared_info->arch.start_info_pfn = __pa(si) >> PAGE_SHIFT;
    2.41  	sprintf(si->magic, "xen-%i.%i-ia64", XEN_VERSION, XEN_SUBVERSION);
    2.42  	si->nr_pages     = d->tot_pages;
    2.43