WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ppc-devel

[XenPPC] [xenppc-unstable] [POWERPC] workaround for broken claim is insu

To: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Subject: [XenPPC] [xenppc-unstable] [POWERPC] workaround for broken claim is insufficient
From: Xen patchbot-xenppc-unstable <patchbot-xenppc-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 18 Aug 2006 00:40:42 +0000
Delivery-date: Fri, 18 Aug 2006 03:15:36 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ppc-devel-request@lists.xensource.com?subject=help>
List-id: Xen PPC development <xen-ppc-devel.lists.xensource.com>
List-post: <mailto:xen-ppc-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
# Node ID 7855f2e8074882ae27ac2e2a700124bcc3f9c579
# Parent  d16b31d3998a29adeea7bb6f892636181ae6eaf4
[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@xxxxxxxxxxxxxx>
---
 xen/arch/powerpc/boot_of.c |   34 +++++++++++++++++++++++-----------
 1 files changed, 23 insertions(+), 11 deletions(-)

diff -r d16b31d3998a -r 7855f2e80748 xen/arch/powerpc/boot_of.c
--- a/xen/arch/powerpc/boot_of.c        Thu Aug 17 19:03:06 2006 -0400
+++ b/xen/arch/powerpc/boot_of.c        Thu Aug 17 20:38:08 2006 -0400
@@ -685,7 +685,6 @@ static int boot_of_fixup_chosen(void *me
 }
 
 static ulong space_base;
-static int broken_claim;
 
 /*
  * The following function is necessary because we cannot depend on all
@@ -706,14 +705,20 @@ static ulong find_space(u32 size, u32 al
     if (align == 0)
         of_panic("cannot call %s() with align of 0\n", __func__);
 
-    if (!broken_claim) {
-        /* just try and claim it to the FW chosen address */
-        base = of_claim(0, size, align);
-        if (base != OF_FAILURE)
-            return base;
-        of_printf("%s: Firmware does not allocate memory for you\n", __func__);
-        broken_claim = 1;
-    }
+#ifdef BROKEN_CLAIM_WORKAROUND
+    {
+        static int broken_claim;
+        if (!broken_claim) {
+            /* just try and claim it to the FW chosen address */
+            base = of_claim(0, size, align);
+            if (base != OF_FAILURE)
+                return base;
+            of_printf("%s: Firmware does not allocate memory for you\n",
+                      __func__);
+            broken_claim = 1;
+        }
+    }
+#endif
 
     of_printf("%s base=0x%016lx  eomem=0x%016lx  size=0x%08x  align=0x%x\n",
                     __func__, space_base, eomem, size, align);
@@ -915,15 +920,22 @@ static void boot_of_module(ulong r3, ulo
 
     /* snapshot the tree */
     oftree = (void*)find_space(oftree_sz, PAGE_SIZE, mbi);
-    if (oftree == 0) of_panic("Could not allocate OFD tree\n");
+    if (oftree == 0)
+        of_panic("Could not allocate OFD tree\n");
 
     of_printf("creating oftree\n");
     of_test("package-to-path");
-    ofd_create(oftree, oftree_sz);
+    oftree = ofd_create(oftree, oftree_sz);
     pkg_save(oftree);
+
+    if (ofd_size(oftree) > oftree_sz)
+         of_panic("Could not fit all of native devtree\n");
 
     boot_of_fixup_refs(oftree);
     boot_of_fixup_chosen(oftree);
+
+    if (ofd_size(oftree) > oftree_sz)
+         of_panic("Could not fit all devtree fixups\n");
 
     ofd_walk(oftree, OFD_ROOT, /* add_hype_props */ NULL, 2);
 

_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [XenPPC] [xenppc-unstable] [POWERPC] workaround for broken claim is insufficient, Xen patchbot-xenppc-unstable <=