ia64/xen-unstable

changeset 13112:613ccf4ca46b

[IA64] Change dom0's initrd image load area so that it follows start info.

It becomes non-sense to use dom0_size if dom0 memoy is assigned sparsely.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author awilliam@xenbuild2.aw
date Thu Jan 04 14:50:26 2007 -0700 (2007-01-04)
parents 912f8af36878
children 98f48cf14d98
files xen/arch/ia64/xen/domain.c
line diff
     1.1 --- a/xen/arch/ia64/xen/domain.c	Tue Jan 02 16:42:09 2007 -0700
     1.2 +++ b/xen/arch/ia64/xen/domain.c	Thu Jan 04 14:50:26 2007 -0700
     1.3 @@ -1051,10 +1051,11 @@ int construct_dom0(struct domain *d,
     1.4  	if(initrd_start && initrd_len){
     1.5  	    unsigned long offset;
     1.6  
     1.7 -	    pinitrd_start= dom0_size - (PAGE_ALIGN(initrd_len) + 4*1024*1024);
     1.8 -	    if (pinitrd_start <= pstart_info)
     1.9 -		panic("%s:enough memory is not assigned to dom0", __func__);
    1.10 -
    1.11 +	    /* The next page aligned boundary after the start info.
    1.12 +	       Note: EFI_PAGE_SHIFT = 12 <= PAGE_SHIFT */
    1.13 +	    pinitrd_start = pstart_info + PAGE_SIZE;
    1.14 +	    if (pinitrd_start + initrd_len >= dom0_size)
    1.15 +		    panic("%s: not enough memory assigned to dom0", __func__);
    1.16  	    for (offset = 0; offset < initrd_len; offset += PAGE_SIZE) {
    1.17  		struct page_info *p;
    1.18  		p = assign_new_domain_page(d, pinitrd_start + offset);
    1.19 @@ -1109,10 +1110,6 @@ int construct_dom0(struct domain *d,
    1.20  	/* Copy the OS image. */
    1.21  	loaddomainelfimage(d,image_start);
    1.22  
    1.23 -	/* Copy the initial ramdisk. */
    1.24 -	//if ( initrd_len != 0 )
    1.25 -	//    memcpy((void *)vinitrd_start, initrd_start, initrd_len);
    1.26 -
    1.27  	BUILD_BUG_ON(sizeof(start_info_t) + sizeof(dom0_vga_console_info_t) +
    1.28  	             sizeof(struct ia64_boot_param) > PAGE_SIZE);
    1.29  
    1.30 @@ -1161,8 +1158,7 @@ int construct_dom0(struct domain *d,
    1.31  	bp->console_info.orig_y = bp->console_info.num_rows == 0 ?
    1.32  	                          0 : bp->console_info.num_rows - 1;
    1.33  
    1.34 -	bp->initrd_start = dom0_size -
    1.35 -	             (PAGE_ALIGN(ia64_boot_param->initrd_size) + 4*1024*1024);
    1.36 +	bp->initrd_start = pinitrd_start;
    1.37  	bp->initrd_size = ia64_boot_param->initrd_size;
    1.38  
    1.39  	ci = (dom0_vga_console_info_t *)((unsigned char *)si +