[Lguest] Error inserting lg: Cannot allocate memory

Rusty Russell rusty at rustcorp.com.au
Tue Mar 4 21:11:25 EST 2008


On Monday 25 February 2008 09:05:49 Stefan Hellermann wrote:
> Hello,
>
> I would like to try lguest, but I it doesn't work here. When I load lg it
> says: FATAL: Error inserting lg
> (/lib/modules/2.6.25-rc2-via/kernel/drivers/lguest/lg.ko): Cannot allocate
> memory
>
> dmesg says:
> allocation failed: out of vmalloc space - use vmalloc=<size> to increase
> size. lguest: could not map switcher pages high

OK, I found this one (sorry for the delay, I was away).

Does this work for you?  It works for me...

Thanks very much for your report!
Rusty.
==
Robert Bragg's 5dc331852848a38ca00a2817e5b98a1d0561b116 tightened
(ie. fixed) the checking in __get_vm_area, and it broke lguest.

lguest should pass a valid "end" parameter, not some random constant.

Signed-off-by: Rusty Russell <rusty at rustcorp.com.au>
Cc: Robert Bragg <robert at sixbynine.org>

diff -r f5dc1442dc61 drivers/lguest/core.c
--- a/drivers/lguest/core.c	Tue Mar 04 14:21:38 2008 +1100
+++ b/drivers/lguest/core.c	Tue Mar 04 21:06:41 2008 +1100
@@ -71,9 +71,11 @@ static __init int map_switcher(void)
 
 	/* Now we reserve the "virtual memory area" we want: 0xFFC00000
 	 * (SWITCHER_ADDR).  We might not get it in theory, but in practice
-	 * it's worked so far. */
+	 * it's worked so far.  The +1 is because __get_vm_area allocates a
+	 * guard page, so we need space for that. */
 	switcher_vma = __get_vm_area(TOTAL_SWITCHER_PAGES * PAGE_SIZE,
-				       VM_ALLOC, SWITCHER_ADDR, VMALLOC_END);
+				     VM_ALLOC, SWITCHER_ADDR, SWITCHER_ADDR
+				     + (TOTAL_SWITCHER_PAGES+1) * PAGE_SIZE);
 	if (!switcher_vma) {
 		err = -ENOMEM;
 		printk("lguest: could not map switcher pages high\n");



More information about the Lguest mailing list