diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2013-04-22 00:40:38 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2013-04-22 02:01:36 -0400 |
commit | 93a2cdff98243df06bafd3c4f3b31b38f0d0fe3e (patch) | |
tree | cfda9a918a92ac0308e1c888489c83c0b243138a /drivers/lguest/core.c | |
parent | 856c608827928d29f80605e85fc3f8f0ab3af4fb (diff) |
lguest: assume Switcher text is a single page.
ie. SHARED_SWITCHER_PAGES == 1. It is well under a page, and it's a
minor simplification: it's nice to have *one* simplification in a
patch series!
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/lguest/core.c')
-rw-r--r-- | drivers/lguest/core.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/lguest/core.c b/drivers/lguest/core.c index 211d8267992b..4209065b9b1e 100644 --- a/drivers/lguest/core.c +++ b/drivers/lguest/core.c | |||
@@ -52,6 +52,13 @@ static __init int map_switcher(void) | |||
52 | * easy. | 52 | * easy. |
53 | */ | 53 | */ |
54 | 54 | ||
55 | /* We assume Switcher text fits into a single page. */ | ||
56 | if (end_switcher_text - start_switcher_text > PAGE_SIZE) { | ||
57 | printk(KERN_ERR "lguest: switcher text too large (%zu)\n", | ||
58 | end_switcher_text - start_switcher_text); | ||
59 | return -EINVAL; | ||
60 | } | ||
61 | |||
55 | /* | 62 | /* |
56 | * We allocate an array of struct page pointers. map_vm_area() wants | 63 | * We allocate an array of struct page pointers. map_vm_area() wants |
57 | * this, rather than just an array of pages. | 64 | * this, rather than just an array of pages. |
@@ -326,7 +333,7 @@ static int __init init(void) | |||
326 | goto out; | 333 | goto out; |
327 | 334 | ||
328 | /* Now we set up the pagetable implementation for the Guests. */ | 335 | /* Now we set up the pagetable implementation for the Guests. */ |
329 | err = init_pagetables(switcher_pages, SHARED_SWITCHER_PAGES); | 336 | err = init_pagetables(switcher_pages); |
330 | if (err) | 337 | if (err) |
331 | goto unmap; | 338 | goto unmap; |
332 | 339 | ||