diff options
author | 2013-09-21 10:01:27 +0000 | |
---|---|---|
committer | 2013-09-21 10:01:27 +0000 | |
commit | 0346fa40d3906b745431515ad257204b5610c560 (patch) | |
tree | 36a0d1301be93c604eb5b08270a7f9de4c39e2f7 | |
parent | Add support for root on nfs using v3. Code adapted from NetBSD. (diff) | |
download | wireguard-openbsd-0346fa40d3906b745431515ad257204b5610c560.tar.xz wireguard-openbsd-0346fa40d3906b745431515ad257204b5610c560.zip |
Don't invoke pmap_copy() on map holes.
-rw-r--r-- | sys/uvm/uvm_map.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/uvm/uvm_map.c b/sys/uvm/uvm_map.c index af0aa631469..949fbe4f081 100644 --- a/sys/uvm/uvm_map.c +++ b/sys/uvm/uvm_map.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_map.c,v 1.162 2013/05/30 15:17:59 tedu Exp $ */ +/* $OpenBSD: uvm_map.c,v 1.163 2013/09/21 10:01:27 miod Exp $ */ /* $NetBSD: uvm_map.c,v 1.86 2000/11/27 08:40:03 chs Exp $ */ /* @@ -3362,8 +3362,9 @@ uvm_mapent_forkshared(struct vmspace *new_vm, struct vm_map *new_map, * but if it is there it will reduce the number of * page faults in the new proc. */ - pmap_copy(new_map->pmap, old_map->pmap, new_entry->start, - (new_entry->end - new_entry->start), new_entry->start); + if (!UVM_ET_ISHOLE(new_entry)) + pmap_copy(new_map->pmap, old_map->pmap, new_entry->start, + (new_entry->end - new_entry->start), new_entry->start); /* * Update process statistics. @@ -3516,10 +3517,11 @@ uvm_mapent_forkcopy(struct vmspace *new_vm, struct vm_map *new_map, * XXX: need a way to tell if this does anything */ - pmap_copy(new_map->pmap, old_map->pmap, - new_entry->start, - (old_entry->end - old_entry->start), - old_entry->start); + if (!UVM_ET_ISHOLE(new_entry)) + pmap_copy(new_map->pmap, old_map->pmap, + new_entry->start, + (old_entry->end - old_entry->start), + old_entry->start); /* * protect the child's mappings if necessary |