# HG changeset patch # User yamahata@xxxxxxxxxxxxx # Date 1166586635 -32400 # Node ID 39d2b340885f1cf4367651e976c36ab7f29a051b # Parent 8fc6b39c225608f03944cc642c685490cdf62a29 changed 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. PATCHNAME: dom0_initrd_start Signed-off-by: Isaku Yamahata diff -r 8fc6b39c2256 -r 39d2b340885f xen/arch/ia64/xen/domain.c --- a/xen/arch/ia64/xen/domain.c Mon Dec 11 17:08:32 2006 +0900 +++ b/xen/arch/ia64/xen/domain.c Wed Dec 20 12:50:35 2006 +0900 @@ -1051,10 +1051,12 @@ int construct_dom0(struct domain *d, if(initrd_start && initrd_len){ unsigned long offset; - pinitrd_start= dom0_size - (PAGE_ALIGN(initrd_len) + 4*1024*1024); - if (pinitrd_start <= pstart_info) - panic("%s:enough memory is not assigned to dom0", __func__); - + /* the next page aligned boundary after the start info. + note:EFI_PAGE_SHIFT = 12 <= PAGE_SHIFT */ + pinitrd_start = pstart_info + PAGE_SIZE; + if (pinitrd_start + initrd_len >= dom0_size) + panic("%s:enough memory is not assigned to dom0", + __func__); for (offset = 0; offset < initrd_len; offset += PAGE_SIZE) { struct page_info *p; p = assign_new_domain_page(d, pinitrd_start + offset); @@ -1109,10 +1111,6 @@ int construct_dom0(struct domain *d, /* Copy the OS image. */ loaddomainelfimage(d,image_start); - /* Copy the initial ramdisk. */ - //if ( initrd_len != 0 ) - // memcpy((void *)vinitrd_start, initrd_start, initrd_len); - BUILD_BUG_ON(sizeof(start_info_t) + sizeof(dom0_vga_console_info_t) + sizeof(struct ia64_boot_param) > PAGE_SIZE); @@ -1161,8 +1159,7 @@ int construct_dom0(struct domain *d, bp->console_info.orig_y = bp->console_info.num_rows == 0 ? 0 : bp->console_info.num_rows - 1; - bp->initrd_start = dom0_size - - (PAGE_ALIGN(ia64_boot_param->initrd_size) + 4*1024*1024); + bp->initrd_start = pinitrd_start; bp->initrd_size = ia64_boot_param->initrd_size; ci = (dom0_vga_console_info_t *)((unsigned char *)si +