Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/uvm In uvm_pagermapin(), pass VM_PROT_READ|VM_PROT_WRITE...
details: https://anonhg.NetBSD.org/src/rev/fa84080046c7
branches: trunk
changeset: 473240:fa84080046c7
user: thorpej <thorpej%NetBSD.org@localhost>
date: Wed May 26 06:42:57 1999 +0000
description:
In uvm_pagermapin(), pass VM_PROT_READ|VM_PROT_WRITE as access_type, to
ensure we don't take mod/ref emulation faults in an interrupt context
(e.g. during the i/o operation). This is safe because:
- For a pageout operation, the page is already known to be
modified, and the pagedaemon will pmap_clear_modify() after
the pageout has completed.
- For a pagein operation, pagers must already pmap_clear_modify()
after the pagein operation is complete, because the i/o may have
been done with e.g. programmed i/o.
XXX It would be nice to know the i/o direction so that we can call
XXX pmap_enter() with only the protection and access_type necessary.
diffstat:
sys/uvm/uvm_pager.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diffs (35 lines):
diff -r c804b682b9e6 -r fa84080046c7 sys/uvm/uvm_pager.c
--- a/sys/uvm/uvm_pager.c Wed May 26 06:22:03 1999 +0000
+++ b/sys/uvm/uvm_pager.c Wed May 26 06:42:57 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_pager.c,v 1.18 1999/05/24 23:36:23 thorpej Exp $ */
+/* $NetBSD: uvm_pager.c,v 1.19 1999/05/26 06:42:57 thorpej Exp $ */
/*
*
@@ -116,6 +116,9 @@
*
* we basically just map in a blank map entry to reserve the space in the
* map and then use pmap_enter() to put the mappings in by hand.
+ *
+ * XXX It would be nice to know the direction of the I/O, so that we can
+ * XXX map only what is necessary.
*/
vaddr_t
@@ -172,8 +175,14 @@
panic("uvm_pagermapin: page not busy");
#endif
+ /*
+ * XXX VM_PROT_DEFAULT includes VM_PROT_EXEC; is that
+ * XXX really necessary? It could lead to unnecessary
+ * XXX instruction cache flushes.
+ */
pmap_enter(vm_map_pmap(pager_map), cva, VM_PAGE_TO_PHYS(pp),
- VM_PROT_DEFAULT, TRUE, 0);
+ VM_PROT_DEFAULT, TRUE,
+ VM_PROT_READ | VM_PROT_WRITE);
}
UVMHIST_LOG(maphist, "<- done (KVA=0x%x)", kva,0,0,0);
Home |
Main Index |
Thread Index |
Old Index