- 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.
This commit is contained in:
parent
195c1a2741
commit
9d0ea0969e
@ -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 @@ uvm_vslock(p, addr, len)
|
||||
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 @@ uvm_fork(p1, p2, shared, stack, stacksize)
|
||||
* 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 @@ uvm_swapin(p)
|
||||
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user