Module Name:    src
Committed By:   skrll
Date:           Mon Mar 20 15:51:41 UTC 2017

Modified Files:
        src/sys/uvm: uvm_fault.c

Log Message:
Ensure we pass the prot in flags to pmap_enter when creating a wired
mapping


To generate a diff of this commit:
cvs rdiff -u -r1.198 -r1.199 src/sys/uvm/uvm_fault.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/uvm/uvm_fault.c
diff -u src/sys/uvm/uvm_fault.c:1.198 src/sys/uvm/uvm_fault.c:1.199
--- src/sys/uvm/uvm_fault.c:1.198	Sun Mar 19 23:44:34 2017
+++ src/sys/uvm/uvm_fault.c	Mon Mar 20 15:51:41 2017
@@ -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_fault_lower_neighbor(
 	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);
 }
 
 /*

Reply via email to