Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 87124
b: refs/heads/master
c: f14ae65
h: refs/heads/master
v: v3
  • Loading branch information
Rusty Russell committed Mar 10, 2008
1 parent 5d11d66 commit e8042f9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f73d1e6ca6985b43a1871467463cba632fbc624d
refs/heads/master: f14ae652baa3d72ae378f0c06b89cc2c4ef15ff8
15 changes: 13 additions & 2 deletions trunk/drivers/lguest/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,22 @@ static __init int map_switcher(void)
switcher_page[i] = virt_to_page(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. */
if (SWITCHER_ADDR + (TOTAL_SWITCHER_PAGES+1)*PAGE_SIZE > FIXADDR_START){
err = -ENOMEM;
printk("lguest: mapping switcher would thwack fixmap\n");
goto free_pages;
}

/* 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 end address needs +1 because __get_vm_area
* allocates an extra 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");
Expand Down

0 comments on commit e8042f9

Please sign in to comment.