summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authortegge <tegge@FreeBSD.org>1997-11-14 23:42:10 +0000
committertegge <tegge@FreeBSD.org>1997-11-14 23:42:10 +0000
commit08d3982b7d149131da63561e055f6221aab042f0 (patch)
tree7e186ff95ff5a5d5f565c74a88ca7579da8d5278 /sys
parent5ba8a227e1deb4c8882f7deea2e0712e17b9be7f (diff)
downloadFreeBSD-src-08d3982b7d149131da63561e055f6221aab042f0.zip
FreeBSD-src-08d3982b7d149131da63561e055f6221aab042f0.tar.gz
Simplify map entries during user page wire and user page unwire operations in
vm_map_user_pageable(). Check return value of vm_map_lock_upgrade() during a user page wire operation.
Diffstat (limited to 'sys')
-rw-r--r--sys/vm/vm_map.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
index 77755ed..5024faa 100644
--- a/sys/vm/vm_map.c
+++ b/sys/vm/vm_map.c
@@ -61,7 +61,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_map.c,v 1.95 1997/10/28 15:59:26 bde Exp $
+ * $Id: vm_map.c,v 1.96 1997/11/07 08:53:44 phk Exp $
*/
/*
@@ -1270,8 +1270,9 @@ vm_map_user_pageable(map, start, end, new_pageable)
register vm_offset_t end;
register boolean_t new_pageable;
{
- register vm_map_entry_t entry;
+ vm_map_entry_t entry;
vm_map_entry_t start_entry;
+ vm_offset_t estart;
int rv;
vm_map_lock(map);
@@ -1303,20 +1304,12 @@ vm_map_user_pageable(map, start, end, new_pageable)
if (entry->wired_count == 0)
vm_fault_unwire(map, entry->start, entry->end);
}
+ vm_map_simplify_entry(map,entry);
entry = entry->next;
}
- vm_map_simplify_entry(map, start_entry);
vm_map_clear_recursive(map);
} else {
- /*
- * Because of the possiblity of blocking, etc. We restart
- * through the process's map entries from beginning so that
- * we don't end up depending on a map entry that could have
- * changed.
- */
- rescan:
-
entry = start_entry;
while ((entry != &map->header) && (entry->start < end)) {
@@ -1361,6 +1354,7 @@ vm_map_user_pageable(map, start, end, new_pageable)
entry->wired_count++;
entry->eflags |= MAP_ENTRY_USER_WIRED;
+ estart = entry->start;
/* First we need to allow map modifications */
vm_map_set_recursive(map);
@@ -1380,9 +1374,19 @@ vm_map_user_pageable(map, start, end, new_pageable)
}
vm_map_clear_recursive(map);
- vm_map_lock_upgrade(map);
-
- goto rescan;
+ if (vm_map_lock_upgrade(map)) {
+ vm_map_lock(map);
+ if (vm_map_lookup_entry(map, estart, &entry)
+ == FALSE) {
+ vm_map_unlock(map);
+ (void) vm_map_user_pageable(map,
+ start,
+ estart,
+ TRUE);
+ return (KERN_INVALID_ADDRESS);
+ }
+ }
+ vm_map_simplify_entry(map,entry);
}
}
vm_map_unlock(map);
OpenPOWER on IntegriCloud