summaryrefslogtreecommitdiff
path: root/sys/uvm
diff options
context:
space:
mode:
authorAriane van der Steldt <ariane@cvs.openbsd.org>2012-03-15 22:22:29 +0000
committerAriane van der Steldt <ariane@cvs.openbsd.org>2012-03-15 22:22:29 +0000
commit24a6076cc5e03eddb0caa0e110d93996d78ed385 (patch)
tree929b7fbee70f014eb270ce71797447fb25e92bb4 /sys/uvm
parent5630adf08d35665fdb2202af84a787090a2d27bc (diff)
Fix vmmap SMALL_KERNEL introduced bug.
The if (min < VMMAP_MIN_ADDR) min = VMMAP_MIN_ADDR; code should have moved across when the small_kernel diff moved the initialization from uvm_map_setup() to uvm_map_setup_md(). Prevents a nasty panic on hppa, sparc64 (and possibly other archs). kettenis: the diff make some sense to me
Diffstat (limited to 'sys/uvm')
-rw-r--r--sys/uvm/uvm_map.c30
1 files changed, 22 insertions, 8 deletions
diff --git a/sys/uvm/uvm_map.c b/sys/uvm/uvm_map.c
index ce96b5b6a4a..1b8cc197e77 100644
--- a/sys/uvm/uvm_map.c
+++ b/sys/uvm/uvm_map.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_map.c,v 1.149 2012/03/15 17:52:28 ariane Exp $ */
+/* $OpenBSD: uvm_map.c,v 1.150 2012/03/15 22:22:28 ariane Exp $ */
/* $NetBSD: uvm_map.c,v 1.86 2000/11/27 08:40:03 chs Exp $ */
/*
@@ -2228,13 +2228,6 @@ uvm_map_setup(struct vm_map *map, vaddr_t min, vaddr_t max, int flags)
simple_lock_init(&map->ref_lock);
/*
- * Ensure the selectors will not try to manage page 0;
- * it's too special.
- */
- if (min < VMMAP_MIN_ADDR)
- min = VMMAP_MIN_ADDR;
-
- /*
* Configure the allocators.
*/
if (flags & VM_MAP_ISVMSPACE)
@@ -5008,6 +5001,13 @@ uvm_map_setup_md(struct vm_map *map)
min = map->min_offset;
max = map->max_offset;
+ /*
+ * Ensure the selectors will not try to manage page 0;
+ * it's too special.
+ */
+ if (min < VMMAP_MIN_ADDR)
+ min = VMMAP_MIN_ADDR;
+
#if 0 /* Cool stuff, not yet */
/* Hinted allocations. */
map->uaddr_any[1] = uaddr_hint_create(MAX(min, VMMAP_MIN_ADDR), max,
@@ -5034,6 +5034,13 @@ uvm_map_setup_md(struct vm_map *map)
min = map->min_offset;
max = map->max_offset;
+ /*
+ * Ensure the selectors will not try to manage page 0;
+ * it's too special.
+ */
+ if (min < VMMAP_MIN_ADDR)
+ min = VMMAP_MIN_ADDR;
+
#if 0 /* Cool stuff, not yet */
/* Hinted allocations above 4GB */
map->uaddr_any[0] =
@@ -5062,6 +5069,13 @@ uvm_map_setup_md(struct vm_map *map)
min = map->min_offset;
max = map->max_offset;
+ /*
+ * Ensure the selectors will not try to manage page 0;
+ * it's too special.
+ */
+ if (min < VMMAP_MIN_ADDR)
+ min = VMMAP_MIN_ADDR;
+
#if 0 /* Cool stuff, not yet */
/* Hinted allocations. */
map->uaddr_any[1] = uaddr_hint_create(MAX(min, VMMAP_MIN_ADDR), max,