summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_map.c
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2003-10-31 07:29:28 +0000
committermarcel <marcel@FreeBSD.org>2003-10-31 07:29:28 +0000
commitf48c12c4629584c08c0867e1d5b6205dec3649db (patch)
treee5700e3479b8fc4947c0eaeefe62bcf12aa7714f /sys/vm/vm_map.c
parenta0e6a8adf88add3099981d0aeb9715120e59e5ff (diff)
downloadFreeBSD-src-f48c12c4629584c08c0867e1d5b6205dec3649db.zip
FreeBSD-src-f48c12c4629584c08c0867e1d5b6205dec3649db.tar.gz
Fix two bugs introduced with the rstack functionality and specific to
the rstack functionality: 1. Fix a KASSERT that tests for the address to be above the upward growable stack. Typically for rstack, the faulting address can be identical to the record end of the upward growable entry, and very likely is on ia64. The KASSERT tested for greater than, not greater equal, so whenever the register stack had to be grown the assertion fired. 2. When we grow the upward growable stack entry and adjust the unlying object, don't forget to adjust the size of the VM map. Not doing so would trigger an assert in vm_mapzdtor(). Pointy hat: marcel (for not testing with INVARIANTS).
Diffstat (limited to 'sys/vm/vm_map.c')
-rw-r--r--sys/vm/vm_map.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
index 1f04ac8..b09f4ee 100644
--- a/sys/vm/vm_map.c
+++ b/sys/vm/vm_map.c
@@ -2681,7 +2681,7 @@ Retry:
max_grow = stack_entry->start - end;
} else {
KASSERT(stack_entry->eflags & MAP_ENTRY_GROWS_UP, ("foo"));
- KASSERT(addr > stack_entry->end, ("foo"));
+ KASSERT(addr >= stack_entry->end, ("foo"));
end = (next_entry != &map->header) ? next_entry->start :
stack_entry->end + stack_entry->avail_ssize;
grow_amount = roundup(addr + 1 - stack_entry->end, PAGE_SIZE);
@@ -2800,6 +2800,7 @@ Retry:
OFF_TO_IDX(stack_entry->offset),
(vm_size_t)(stack_entry->end - stack_entry->start),
(vm_size_t)grow_amount)) {
+ map->size += (addr - stack_entry->end);
/* Update the current entry. */
stack_entry->end = addr;
rv = KERN_SUCCESS;
OpenPOWER on IntegriCloud