summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_map.c
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>2000-05-14 18:46:40 +0000
committerdillon <dillon@FreeBSD.org>2000-05-14 18:46:40 +0000
commit5303cc9523865f5f157eefd927defcf1fe3e55b3 (patch)
treefe4458bd8a55f4174c73c43e1de2c80dd253826c /sys/vm/vm_map.c
parent4aaede0d990d332405a61d653419630cf96dc2e3 (diff)
downloadFreeBSD-src-5303cc9523865f5f157eefd927defcf1fe3e55b3.zip
FreeBSD-src-5303cc9523865f5f157eefd927defcf1fe3e55b3.tar.gz
Fixed bug in madvise() / MADV_WILLNEED. When the request is offset
from the base of the first map_entry the call to pmap_object_init_pt() uses the wrong start VA. MFC to follow. PR: i386/18095
Diffstat (limited to 'sys/vm/vm_map.c')
-rw-r--r--sys/vm/vm_map.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
index 0d24451..4eea821 100644
--- a/sys/vm/vm_map.c
+++ b/sys/vm/vm_map.c
@@ -1127,15 +1127,19 @@ vm_map_madvise(map, start, end, behav)
(current != &map->header) && (current->start < end);
current = current->next
) {
+ vm_offset_t useStart;
+
if (current->eflags & MAP_ENTRY_IS_SUB_MAP)
continue;
pindex = OFF_TO_IDX(current->offset);
count = atop(current->end - current->start);
+ useStart = current->start;
if (current->start < start) {
pindex += atop(start - current->start);
count -= atop(start - current->start);
+ useStart = start;
}
if (current->end > end)
count -= atop(current->end - end);
@@ -1148,7 +1152,7 @@ vm_map_madvise(map, start, end, behav)
if (behav == MADV_WILLNEED) {
pmap_object_init_pt(
map->pmap,
- current->start,
+ useStart,
current->object.vm_object,
pindex,
(count << PAGE_SHIFT),
OpenPOWER on IntegriCloud