summaryrefslogtreecommitdiffstats
path: root/drivers/lguest/core.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2013-04-22 14:10:42 +0930
committerRusty Russell <rusty@rustcorp.com.au>2013-04-22 15:45:03 +0930
commit6b39271746de131366a14bcf04f5740cdc4abdef (patch)
treea2f8875e7186df5a801345a61b01b9b2eab9bbca /drivers/lguest/core.c
parent6d0cda93c0d3c8bb0a553047c10f114c88c8af89 (diff)
downloadop-kernel-dev-6b39271746de131366a14bcf04f5740cdc4abdef.zip
op-kernel-dev-6b39271746de131366a14bcf04f5740cdc4abdef.tar.gz
lguest: map Switcher below fixmap.
Now we've adjusted all the code, we can simply set switcher_addr to wherever it needs to go below the fixmaps, rather than asserting that it should be so. With large NR_CPUS and PAE, people were hitting the "mapping switcher would thwack fixmap" message. Reported-by: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/lguest/core.c')
-rw-r--r--drivers/lguest/core.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/lguest/core.c b/drivers/lguest/core.c
index 7e1d7ee..0bf1e4e 100644
--- a/drivers/lguest/core.c
+++ b/drivers/lguest/core.c
@@ -83,18 +83,13 @@ static __init int map_switcher(void)
}
}
- switcher_addr = SWITCHER_ADDR;
-
/*
- * First we check that the Switcher won't overlap the fixmap area at
- * the top of memory. It's currently nowhere near, but it could have
- * very strange effects if it ever happened.
+ * We place the Switcher underneath the fixmap area, which is the
+ * highest virtual address we can get. This is important, since we
+ * tell the Guest it can't access this memory, so we want its ceiling
+ * as high as possible.
*/
- if (switcher_addr + (TOTAL_SWITCHER_PAGES+1)*PAGE_SIZE > FIXADDR_START){
- err = -ENOMEM;
- printk("lguest: mapping switcher would thwack fixmap\n");
- goto free_pages;
- }
+ switcher_addr = FIXADDR_START - (TOTAL_SWITCHER_PAGES+1)*PAGE_SIZE;
/*
* Now we reserve the "virtual memory area" we want. We might
OpenPOWER on IntegriCloud