Re: [PATCH] xen: boot via i386_start_kernel to get early reservations



On Sat, May 24, 2008 at 2:49 AM, Jeremy Fitzhardinge <jeremy@xxxxxxxx> wrote:
Boot Xen via i386_start_kernel so that all the early reservations are
made properly; without these, it will start using the kernel and
pagetables as early heap memory, which is a bit suboptimal.

One tricky part is that reserve_early() will just panic if any of the
early reservations overlap any others. When a Xen domain is built, it
constructs the initial address space as:

kernel text+data+bss
initrd
initial pagetable

Therefore, when reserving the pagetable (from &_end to
init_pg_tables_end), it covers the whole initrd area. If it then
tries to reserve the initrd, it will panic because of the overlap.

The simple fix here is to reserve INIT_PG_TABLE first, and then only
reserve the ramdisk if it doesn't overlap with the previous
reservations. A better/more complex fix might be to make
reserve_early() deal with overlapping reservations.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>
---
...
===================================================================
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1264,5 +1264,5 @@ asmlinkage void __init xen_start_kernel(
}

/* Start the world */
- start_kernel();
+ i386_start_kernel();
}
..

need to do the same thing in arch/x86/lguest.c::lguest_init

YH
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages