Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/uvm Ensure we pass the prot in flags to pmap_enter when ...
details: https://anonhg.NetBSD.org/src/rev/a70176195902
branches: trunk
changeset: 352195:a70176195902
user: skrll <skrll%NetBSD.org@localhost>
date: Mon Mar 20 15:51:41 2017 +0000
description:
Ensure we pass the prot in flags to pmap_enter when creating a wired
mapping
diffstat:
sys/uvm/uvm_fault.c | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
diffs (37 lines):
diff -r 881b3ba55d42 -r a70176195902 sys/uvm/uvm_fault.c
--- a/sys/uvm/uvm_fault.c Mon Mar 20 14:46:28 2017 +0000
+++ b/sys/uvm/uvm_fault.c Mon Mar 20 15:51:41 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_fault.c,v 1.198 2017/03/19 23:44:34 riastradh Exp $ */
+/* $NetBSD: uvm_fault.c,v 1.199 2017/03/20 15:51:41 skrll Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.198 2017/03/19 23:44:34 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.199 2017/03/20 15:51:41 skrll Exp $");
#include "opt_uvmhist.h"
@@ -1820,11 +1820,14 @@
UVM_PAGE_OWN(pg, NULL);
KASSERT(mutex_owned(pg->uobject->vmobjlock));
- (void) pmap_enter(ufi->orig_map->pmap, currva,
- VM_PAGE_TO_PHYS(pg),
+
+ const vm_prot_t mapprot =
readonly ? (flt->enter_prot & ~VM_PROT_WRITE) :
- flt->enter_prot & MASK(ufi->entry),
- PMAP_CANFAIL | (flt->wire_mapping ? PMAP_WIRED : 0));
+ flt->enter_prot & MASK(ufi->entry);
+ const u_int mapflags =
+ PMAP_CANFAIL | (flt->wire_mapping ? (mapprot | PMAP_WIRED) : 0);
+ (void) pmap_enter(ufi->orig_map->pmap, currva,
+ VM_PAGE_TO_PHYS(pg), mapprot, mapflags);
}
/*
Home |
Main Index |
Thread Index |
Old Index