diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2002-04-22 12:50:35 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2002-04-22 12:50:35 +0000 |
commit | 2dfb382e6a22275013c84ddb43a8f482dd2bb99c (patch) | |
tree | 7fd9fa867a0aa1583a92c6895e4a16a1103caf71 | |
parent | f2884cb0222983b6b0823cf896619ef3ed65a8ff (diff) |
do not map malloced memory executable (do avoid possible i-cache prefetch); art@ ok
-rw-r--r-- | sys/uvm/uvm_km.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/uvm/uvm_km.c b/sys/uvm/uvm_km.c index 8f6a730ab5a..5ba6b314d17 100644 --- a/sys/uvm/uvm_km.c +++ b/sys/uvm/uvm_km.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_km.c,v 1.28 2002/03/06 22:05:31 art Exp $ */ +/* $OpenBSD: uvm_km.c,v 1.29 2002/04/22 12:50:34 mickey Exp $ */ /* $NetBSD: uvm_km.c,v 1.42 2001/01/14 02:10:01 thorpej Exp $ */ /* @@ -507,7 +507,7 @@ uvm_km_kmemalloc(map, obj, size, flags) */ if (__predict_false(uvm_map(map, &kva, size, obj, UVM_UNKNOWN_OFFSET, - 0, UVM_MAPFLAG(UVM_PROT_ALL, UVM_PROT_ALL, UVM_INH_NONE, + 0, UVM_MAPFLAG(UVM_PROT_RW, UVM_PROT_RW, UVM_INH_NONE, UVM_ADV_RANDOM, (flags & UVM_KMF_TRYLOCK))) != KERN_SUCCESS)) { UVMHIST_LOG(maphist, "<- done (no VM)",0,0,0,0); @@ -569,11 +569,10 @@ uvm_km_kmemalloc(map, obj, size, flags) if (UVM_OBJ_IS_INTRSAFE_OBJECT(obj)) { pmap_kenter_pa(loopva, VM_PAGE_TO_PHYS(pg), - VM_PROT_ALL); + UVM_PROT_RW); } else { pmap_enter(map->pmap, loopva, VM_PAGE_TO_PHYS(pg), - UVM_PROT_ALL, - PMAP_WIRED | VM_PROT_READ | VM_PROT_WRITE); + UVM_PROT_RW, PMAP_WIRED | UVM_PROT_RW); } loopva += PAGE_SIZE; offset += PAGE_SIZE; |