At present, Xen/PPC fails to boot on the systemsim-gpul public release,
as first reported here by Mark Mergen. The symptom of the failure is
a "Could not allocate RTAS tree" panic.
The problem turned out to be that the first interrupt vector page was
being handed out by the allocator, and one of the checks along the RTAS
allocate path happened to interpret the base address of 0 as a failure
return code. The core problem actually occurred much earlier, and was
that the logic that marks the first four pages as being off limits to
the allocator was never being run because there was an off-by-one error
in the code that parses the "reg" property of the "memory" OF node.
This patch fixes the fencepost error and adds a check for the failure to
initialize the allocator, which would have make Mark's FTB much easier
to debug.
---
boot_of.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff -r 7669fca80bfc xen/arch/powerpc/boot_of.c
--- a/xen/arch/powerpc/boot_of.c Mon Dec 04 11:46:53 2006 -0500
+++ b/xen/arch/powerpc/boot_of.c Sat Dec 09 22:49:14 2006 -0500
@@ -608,7 +608,7 @@ static ulong boot_of_mem_init(void)
if (size_cells == 2 && (r < l) )
size = (size << 32) | reg[r++];
- if (r >= l)
+ if (r > l)
break; /* partial line. Skip */
boot_of_alloc_init(p, addr_cells, size_cells);
@@ -1290,6 +1290,7 @@ multiboot_info_t __init *boot_of_init(
{
static multiboot_info_t mbi;
void *oft;
+ int r;
of_vec = vec;
of_msr = orig_msr;
@@ -1316,7 +1317,9 @@ multiboot_info_t __init *boot_of_init(
of_printf("%s: _start %p _end %p 0x%lx\n", __func__, _start, _end, r6);
boot_of_fix_maple();
- boot_of_mem_init();
+ r = boot_of_mem_init();
+ if (r == 0)
+ of_panic("failure to initialize memory allocator");
boot_of_bootargs(&mbi);
oft = boot_of_module(r3, r4, &mbi);
boot_of_cpus();
_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel
|