Module Name:    src
Committed By:   uebayasi
Date:           Mon Jul 12 06:25:15 UTC 2010

Modified Files:
        src/sys/miscfs/genfs [uebayasi-xip]: genfs_io.c
        src/sys/uvm [uebayasi-xip]: uvm_bio.c uvm_fault.c uvm_loan.c
            uvm_object.c uvm_page.c

Log Message:
Reduce more diff by backing out XIP page specific code.  Allow XIP pages
to be loaned.


To generate a diff of this commit:
cvs rdiff -u -r1.36.2.14 -r1.36.2.15 src/sys/miscfs/genfs/genfs_io.c
cvs rdiff -u -r1.68.2.6 -r1.68.2.7 src/sys/uvm/uvm_bio.c
cvs rdiff -u -r1.166.2.14 -r1.166.2.15 src/sys/uvm/uvm_fault.c
cvs rdiff -u -r1.77.2.2 -r1.77.2.3 src/sys/uvm/uvm_loan.c
cvs rdiff -u -r1.7.2.2 -r1.7.2.3 src/sys/uvm/uvm_object.c
cvs rdiff -u -r1.153.2.43 -r1.153.2.44 src/sys/uvm/uvm_page.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/miscfs/genfs/genfs_io.c
diff -u src/sys/miscfs/genfs/genfs_io.c:1.36.2.14 src/sys/miscfs/genfs/genfs_io.c:1.36.2.15
--- src/sys/miscfs/genfs/genfs_io.c:1.36.2.14	Fri Jul  9 12:57:42 2010
+++ src/sys/miscfs/genfs/genfs_io.c	Mon Jul 12 06:25:15 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfs_io.c,v 1.36.2.14 2010/07/09 12:57:42 uebayasi Exp $	*/
+/*	$NetBSD: genfs_io.c,v 1.36.2.15 2010/07/12 06:25:15 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.36.2.14 2010/07/09 12:57:42 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.36.2.15 2010/07/12 06:25:15 uebayasi Exp $");
 
 #include "opt_xip.h"
 
@@ -878,6 +878,7 @@
 			KASSERT((pg->flags & PG_CLEAN) != 0);
 			KASSERT((pg->flags & PG_DIRECT) != 0);
 			pg->flags |= PG_BUSY;
+			pg->flags &= ~PG_FAKE;
 			pg->uobject = &vp->v_uobj;
 		}
 	}

Index: src/sys/uvm/uvm_bio.c
diff -u src/sys/uvm/uvm_bio.c:1.68.2.6 src/sys/uvm/uvm_bio.c:1.68.2.7
--- src/sys/uvm/uvm_bio.c:1.68.2.6	Fri Jul  9 12:49:21 2010
+++ src/sys/uvm/uvm_bio.c	Mon Jul 12 06:25:14 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_bio.c,v 1.68.2.6 2010/07/09 12:49:21 uebayasi Exp $	*/
+/*	$NetBSD: uvm_bio.c,v 1.68.2.7 2010/07/12 06:25:14 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1998 Chuck Silvers.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_bio.c,v 1.68.2.6 2010/07/09 12:49:21 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_bio.c,v 1.68.2.7 2010/07/12 06:25:14 uebayasi Exp $");
 
 #include "opt_uvmhist.h"
 #include "opt_ubc.h"
@@ -336,14 +336,8 @@
 			continue;
 		}
 
-		mutex_enter(&uobj->vmobjlock);
-
-		if (uvm_pageisdirect_p(pg)) {
-			UVMHIST_LOG(ubchist, "pg is device", i, 0,0,0);
-			goto ubc_fault_enter;
-		}
-
 		KASSERT(uobj == pg->uobject);
+		mutex_enter(&uobj->vmobjlock);
 			
 		if (pg->flags & PG_WANTED) {
 			wakeup(pg);
@@ -379,7 +373,6 @@
 			}
 		}
 
-ubc_fault_enter:
 		/*
 		 * note that a page whose backing store is partially allocated
 		 * is marked as PG_RDONLY.

Index: src/sys/uvm/uvm_fault.c
diff -u src/sys/uvm/uvm_fault.c:1.166.2.14 src/sys/uvm/uvm_fault.c:1.166.2.15
--- src/sys/uvm/uvm_fault.c:1.166.2.14	Mon Jul 12 02:28:33 2010
+++ src/sys/uvm/uvm_fault.c	Mon Jul 12 06:25:14 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_fault.c,v 1.166.2.14 2010/07/12 02:28:33 uebayasi Exp $	*/
+/*	$NetBSD: uvm_fault.c,v 1.166.2.15 2010/07/12 06:25:14 uebayasi Exp $	*/
 
 /*
  *
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.166.2.14 2010/07/12 02:28:33 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.166.2.15 2010/07/12 06:25:14 uebayasi Exp $");
 
 #include "opt_uvmhist.h"
 #include "opt_xip.h"
@@ -1767,6 +1767,12 @@
 	uvm_pageenqueue(pg);
 	mutex_exit(&uvm_pageqlock);
 
+uvm_fault_lower_neighbor_enter:
+	UVMHIST_LOG(maphist,
+	    "  MAPPING: n obj: pm=0x%x, va=0x%x, pg=0x%x",
+	    ufi->orig_map->pmap, currva, pg, 0);
+	uvmexp.fltnomap++;
+
 	/*
 	 * Since this page isn't the page that's actually faulting,
 	 * ignore pmap_enter() failures; it's not critical that we
@@ -1780,15 +1786,9 @@
 	KASSERT(!UVM_OBJ_IS_CLEAN(pg->uobject) ||
 	    (pg->flags & PG_CLEAN) != 0);
 
-uvm_fault_lower_neighbor_enter:
 	pg->flags &= ~(PG_BUSY);
 	UVM_PAGE_OWN(pg, NULL);
 
-	UVMHIST_LOG(maphist,
-	    "  MAPPING: n obj: pm=0x%x, va=0x%x, pg=0x%x",
-	    ufi->orig_map->pmap, currva, pg, 0);
-	uvmexp.fltnomap++;
-
 	(void) pmap_enter(ufi->orig_map->pmap, currva,
 	    VM_PAGE_TO_PHYS(pg),
 	    readonly ? (flt->enter_prot & ~VM_PROT_WRITE) :
@@ -1962,11 +1962,6 @@
 	pg = uobjpage;		/* map in the actual object */
 	uvmexp.flt_obj++;
 
-	if (uvm_pageisdirect_p(uobjpage)) {
-		/* XIP'ed device pages are always read-only */
-		goto uvm_fault_lower_direct_done;
-	}
-
 	if (UVM_ET_ISCOPYONWRITE(ufi->entry) ||
 	    UVM_OBJ_NEEDS_WRITEFAULT(uobjpage->uobject))
 		flt->enter_prot &= ~VM_PROT_WRITE;
@@ -1983,7 +1978,6 @@
 	}
 	KASSERT(pg == uobjpage);
 
-uvm_fault_lower_direct_done:
 	return uvm_fault_lower_enter(ufi, flt, uobj, NULL, pg, uobjpage);
 }
 
@@ -2180,11 +2174,6 @@
 	    pg->flags & PG_RDONLY ? flt->enter_prot & ~VM_PROT_WRITE : flt->enter_prot,
 	    flt->access_type | PMAP_CANFAIL | (flt->wire_mapping ? PMAP_WIRED : 0)) != 0) {
 
-		if (uvm_pageisdirect_p(pg)) {
-			/* Device pages never involve paging activity. */
-			goto uvm_fault_lower_enter_error_done;
-		}
-
 		/*
 		 * No need to undo what we did; we can simply think of
 		 * this as the pmap throwing away the mapping information.
@@ -2202,7 +2191,6 @@
 		 */
 		KASSERT((pg->flags & PG_RELEASED) == 0);
 
-uvm_fault_lower_enter_error_done:
 		pg->flags &= ~(PG_BUSY|PG_FAKE|PG_WANTED);
 		UVM_PAGE_OWN(pg, NULL);
 

Index: src/sys/uvm/uvm_loan.c
diff -u src/sys/uvm/uvm_loan.c:1.77.2.2 src/sys/uvm/uvm_loan.c:1.77.2.3
--- src/sys/uvm/uvm_loan.c:1.77.2.2	Mon May 31 13:26:38 2010
+++ src/sys/uvm/uvm_loan.c	Mon Jul 12 06:25:14 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_loan.c,v 1.77.2.2 2010/05/31 13:26:38 uebayasi Exp $	*/
+/*	$NetBSD: uvm_loan.c,v 1.77.2.3 2010/07/12 06:25:14 uebayasi Exp $	*/
 
 /*
  *
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_loan.c,v 1.77.2.2 2010/05/31 13:26:38 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_loan.c,v 1.77.2.3 2010/07/12 06:25:14 uebayasi Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -540,10 +540,6 @@
 		}
 		if (error)
 			goto fail;
-		if (uvm_pageisdirect_p(pgpp[0])) {
-			error = EBUSY;
-			goto fail2;
-		}
 
 		KASSERT(npages > 0);
 
@@ -610,7 +606,6 @@
 fail:
 	uvm_unloan(origpgpp, ndone, UVM_LOAN_TOPAGE);
 
-fail2:
 	return error;
 }
 
@@ -662,7 +657,7 @@
 	 * then we fail the loan.
 	 */
 
-	if ((error && error != EBUSY) || uvm_pageisdirect_p(pg)) {
+	if (error && error != EBUSY) {
 		uvmfault_unlockall(ufi, amap, uobj, NULL);
 		return (-1);
 	}

Index: src/sys/uvm/uvm_object.c
diff -u src/sys/uvm/uvm_object.c:1.7.2.2 src/sys/uvm/uvm_object.c:1.7.2.3
--- src/sys/uvm/uvm_object.c:1.7.2.2	Mon May 31 13:26:38 2010
+++ src/sys/uvm/uvm_object.c	Mon Jul 12 06:25:14 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_object.c,v 1.7.2.2 2010/05/31 13:26:38 uebayasi Exp $	*/
+/*	$NetBSD: uvm_object.c,v 1.7.2.3 2010/07/12 06:25:14 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_object.c,v 1.7.2.2 2010/05/31 13:26:38 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_object.c,v 1.7.2.3 2010/07/12 06:25:14 uebayasi Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvmhist.h"
@@ -85,9 +85,6 @@
 		mutex_enter(&uobj->vmobjlock);
 		for (i = 0; i < npages; i++) {
 
-			if (uvm_pageisdirect_p(pgs[i]))
-				continue;
-
 			KASSERT(pgs[i] != NULL);
 			KASSERT(!(pgs[i]->flags & PG_RELEASED));
 

Index: src/sys/uvm/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.153.2.43 src/sys/uvm/uvm_page.c:1.153.2.44
--- src/sys/uvm/uvm_page.c:1.153.2.43	Fri Jul  9 12:49:21 2010
+++ src/sys/uvm/uvm_page.c	Mon Jul 12 06:25:14 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.c,v 1.153.2.43 2010/07/09 12:49:21 uebayasi Exp $	*/
+/*	$NetBSD: uvm_page.c,v 1.153.2.44 2010/07/12 06:25:14 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.43 2010/07/09 12:49:21 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.44 2010/07/12 06:25:14 uebayasi Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvmhist.h"
@@ -870,7 +870,7 @@
 		paddr_t paddr = (start + i) << PAGE_SHIFT;
 
 		pg->phys_addr = paddr;
-		pg->flags |= PG_RDONLY | PG_DIRECT | PG_CLEAN;
+		pg->flags |= PG_FAKE | PG_RDONLY | PG_DIRECT | PG_CLEAN;
 #ifdef __HAVE_VM_PAGE_MD
 		VM_MDPAGE_INIT(&pg->mdpage, paddr);
 #endif

Reply via email to