Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/uvm - uvm_fork()/uvm_swapin(): pass VM_PROT_READ|VM_PROT...



details:   https://anonhg.NetBSD.org/src/rev/c4bc9e5a4364
branches:  trunk
changeset: 473226:c4bc9e5a4364
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Wed May 26 00:33:52 1999 +0000

description:
- uvm_fork()/uvm_swapin(): pass VM_PROT_READ|VM_PROT_WRITE access_type
  to uvm_fault_wire(), to guarantee that the kernel stacks will not
  cause even a mod/ref emulation fault.
- uvm_vslock(): pass VM_PROT_NONE until this function is updated.

diffstat:

 sys/uvm/uvm_glue.c |  14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diffs (45 lines):

diff -r 9cae391d1f40 -r c4bc9e5a4364 sys/uvm/uvm_glue.c
--- a/sys/uvm/uvm_glue.c        Wed May 26 00:32:42 1999 +0000
+++ b/sys/uvm/uvm_glue.c        Wed May 26 00:33:52 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_glue.c,v 1.20 1999/05/13 21:58:38 thorpej Exp $    */
+/*     $NetBSD: uvm_glue.c,v 1.21 1999/05/26 00:33:52 thorpej Exp $    */
 
 /* 
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -229,8 +229,10 @@
        caddr_t addr;
        size_t  len;
 {
+
+       /* XXX VM_PROT_NONE */
        uvm_fault_wire(&p->p_vmspace->vm_map, trunc_page(addr), 
-           round_page(addr+len));
+           round_page(addr+len), VM_PROT_NONE);
 }
 
 /*
@@ -285,9 +287,12 @@
         * and the kernel stack.  Wired state is stored in p->p_flag's
         * P_INMEM bit rather than in the vm_map_entry's wired count
         * to prevent kernel_map fragmentation.
+        *
+        * Note the kernel stack gets read/write accesses right off
+        * the bat.
         */
        rv = uvm_fault_wire(kernel_map, (vaddr_t)up,
-           (vaddr_t)up + USPACE);
+           (vaddr_t)up + USPACE, VM_PROT_READ | VM_PROT_WRITE);
        if (rv != KERN_SUCCESS)
                panic("uvm_fork: uvm_fault_wire failed: %d", rv);
 
@@ -373,7 +378,8 @@
 
        addr = (vaddr_t)p->p_addr;
        /* make P_INMEM true */
-       uvm_fault_wire(kernel_map, addr, addr + USPACE);
+       uvm_fault_wire(kernel_map, addr, addr + USPACE,
+           VM_PROT_READ | VM_PROT_WRITE);
 
        /*
         * Some architectures need to be notified when the user area has



Home | Main Index | Thread Index | Old Index