direct-io.hg

changeset 11359:639eb7e6446e

[XEN][POWERPC] workaround for broken claim is insufficient

Ifdef'ed out so we can revisit, maybe.
Also add a check to make sure we allocated enough for the devtree.

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 Thu Aug 17 20:38:08 2006 -0400 (2006-08-17)
parents 47078e89e663
children 3f87db7cac89
files xen/arch/powerpc/boot_of.c
line diff
     1.1 --- a/xen/arch/powerpc/boot_of.c	Thu Aug 17 19:03:06 2006 -0400
     1.2 +++ b/xen/arch/powerpc/boot_of.c	Thu Aug 17 20:38:08 2006 -0400
     1.3 @@ -685,7 +685,6 @@ static int boot_of_fixup_chosen(void *me
     1.4  }
     1.5  
     1.6  static ulong space_base;
     1.7 -static int broken_claim;
     1.8  
     1.9  /*
    1.10   * The following function is necessary because we cannot depend on all
    1.11 @@ -706,14 +705,20 @@ static ulong find_space(u32 size, u32 al
    1.12      if (align == 0)
    1.13          of_panic("cannot call %s() with align of 0\n", __func__);
    1.14  
    1.15 -    if (!broken_claim) {
    1.16 -        /* just try and claim it to the FW chosen address */
    1.17 -        base = of_claim(0, size, align);
    1.18 -        if (base != OF_FAILURE)
    1.19 -            return base;
    1.20 -        of_printf("%s: Firmware does not allocate memory for you\n", __func__);
    1.21 -        broken_claim = 1;
    1.22 +#ifdef BROKEN_CLAIM_WORKAROUND
    1.23 +    {
    1.24 +        static int broken_claim;
    1.25 +        if (!broken_claim) {
    1.26 +            /* just try and claim it to the FW chosen address */
    1.27 +            base = of_claim(0, size, align);
    1.28 +            if (base != OF_FAILURE)
    1.29 +                return base;
    1.30 +            of_printf("%s: Firmware does not allocate memory for you\n",
    1.31 +                      __func__);
    1.32 +            broken_claim = 1;
    1.33 +        }
    1.34      }
    1.35 +#endif
    1.36  
    1.37      of_printf("%s base=0x%016lx  eomem=0x%016lx  size=0x%08x  align=0x%x\n",
    1.38                      __func__, space_base, eomem, size, align);
    1.39 @@ -915,16 +920,23 @@ static void boot_of_module(ulong r3, ulo
    1.40  
    1.41      /* snapshot the tree */
    1.42      oftree = (void*)find_space(oftree_sz, PAGE_SIZE, mbi);
    1.43 -    if (oftree == 0) of_panic("Could not allocate OFD tree\n");
    1.44 +    if (oftree == 0)
    1.45 +        of_panic("Could not allocate OFD tree\n");
    1.46  
    1.47      of_printf("creating oftree\n");
    1.48      of_test("package-to-path");
    1.49 -    ofd_create(oftree, oftree_sz);
    1.50 +    oftree = ofd_create(oftree, oftree_sz);
    1.51      pkg_save(oftree);
    1.52  
    1.53 +    if (ofd_size(oftree) > oftree_sz)
    1.54 +         of_panic("Could not fit all of native devtree\n");
    1.55 +
    1.56      boot_of_fixup_refs(oftree);
    1.57      boot_of_fixup_chosen(oftree);
    1.58  
    1.59 +    if (ofd_size(oftree) > oftree_sz)
    1.60 +         of_panic("Could not fit all devtree fixups\n");
    1.61 +
    1.62      ofd_walk(oftree, OFD_ROOT, /* add_hype_props */ NULL, 2);
    1.63  
    1.64      mods[1].mod_start = (ulong)oftree;