ia64/xen-unstable

changeset 11364:512078953bbb

[XEN][POWERPC] Boot Module freeing

- Fix bad logic that frees the modules anyway.
- Allow for the absence of a Dom0 to continue execution until it's
time to load it, useful for debugging bringup code.

Signed-off-by: Jimi Xenidis <jimix@watson.ibm.com>
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
author Jimi Xenidis <jimix@watson.ibm.com>
date Fri Aug 18 05:39:01 2006 -0400 (2006-08-18)
parents 3f87db7cac89
children 1bbb88b5dfeb
files xen/arch/powerpc/domain_build.c xen/arch/powerpc/setup.c
line diff
     1.1 --- a/xen/arch/powerpc/domain_build.c	Fri Aug 18 05:17:14 2006 -0400
     1.2 +++ b/xen/arch/powerpc/domain_build.c	Fri Aug 18 05:39:01 2006 -0400
     1.3 @@ -118,13 +118,18 @@ int construct_dom0(struct domain *d,
     1.4      BUG_ON(d->domain_id != 0);
     1.5      BUG_ON(d->vcpu[0] == NULL);
     1.6  
     1.7 +    if (image_len == 0)
     1.8 +        panic("No Dom0 image supplied\n");
     1.9 +
    1.10      cpu_init_vcpu(v);
    1.11  
    1.12      memset(&dsi, 0, sizeof(struct domain_setup_info));
    1.13      dsi.image_addr = image_start;
    1.14      dsi.image_len  = image_len;
    1.15  
    1.16 +    printk("Trying Dom0 as 64bit ELF\n");
    1.17      if ((rc = parseelfimage(&dsi)) != 0) {
    1.18 +        printk("Trying Dom0 as 32bit ELF\n");
    1.19          if ((rc = parseelfimage_32(&dsi)) != 0)
    1.20              return rc;
    1.21          am64 = 0;
     2.1 --- a/xen/arch/powerpc/setup.c	Fri Aug 18 05:17:14 2006 -0400
     2.2 +++ b/xen/arch/powerpc/setup.c	Fri Aug 18 05:39:01 2006 -0400
     2.3 @@ -326,6 +326,9 @@ static void __init __start_xen(multiboot
     2.4      for (i = 0; i < mbi->mods_count; i++) {
     2.5          u32 s;
     2.6  
     2.7 +        if(mod[i].mod_end == mod[i].mod_start)
     2.8 +            continue;
     2.9 +
    2.10          s = ALIGN_DOWN(mod[i].mod_start, PAGE_SIZE);
    2.11  
    2.12          if (mod[i].mod_start > (ulong)_start &&
    2.13 @@ -337,7 +340,9 @@ static void __init __start_xen(multiboot
    2.14          if (s < freemem) 
    2.15              panic("module addresses must assend\n");
    2.16  
    2.17 -        freemem = free_xenheap(freemem, s);
    2.18 +        free_xenheap(freemem, s);
    2.19 +        freemem = ALIGN_UP(mod[i].mod_end, PAGE_SIZE);
    2.20 +        
    2.21      }
    2.22  
    2.23      /* the rest of the xenheap, starting at the end of modules */