diff --git a/sys/uvm/uvm_glue.c b/sys/uvm/uvm_glue.c index 0a6ceee76987..0449b81b01a8 100644 --- a/sys/uvm/uvm_glue.c +++ b/sys/uvm/uvm_glue.c @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_glue.c,v 1.125 2008/04/24 15:35:31 ad Exp $ */ +/* $NetBSD: uvm_glue.c,v 1.126 2008/04/27 11:39:46 ad Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -67,7 +67,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_glue.c,v 1.125 2008/04/24 15:35:31 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_glue.c,v 1.126 2008/04/27 11:39:46 ad Exp $"); #include "opt_coredump.h" #include "opt_kgdb.h" @@ -401,9 +401,11 @@ uvm_proc_exit(struct proc *p) /* * borrow proc0's address space. */ + kpreempt_disable(); pmap_deactivate(l); p->p_vmspace = proc0.p_vmspace; pmap_activate(l); + kpreempt_enable(); uvmspace_free(ovm); } diff --git a/sys/uvm/uvm_map.c b/sys/uvm/uvm_map.c index 3e883ccd167b..4b756283bbf2 100644 --- a/sys/uvm/uvm_map.c +++ b/sys/uvm/uvm_map.c @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_map.c,v 1.253 2008/04/26 13:44:00 yamt Exp $ */ +/* $NetBSD: uvm_map.c,v 1.254 2008/04/27 11:39:47 ad Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -71,7 +71,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.253 2008/04/26 13:44:00 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.254 2008/04/27 11:39:47 ad Exp $"); #include "opt_ddb.h" #include "opt_uvmhist.h" @@ -3986,9 +3986,11 @@ uvmspace_unshare(struct lwp *l) /* make a new vmspace, still holding old one */ nvm = uvmspace_fork(ovm); + kpreempt_disable(); pmap_deactivate(l); /* unbind old vmspace */ p->p_vmspace = nvm; pmap_activate(l); /* switch to new vmspace */ + kpreempt_enable(); uvmspace_free(ovm); /* drop reference to old vmspace */ } @@ -4065,9 +4067,11 @@ uvmspace_exec(struct lwp *l, vaddr_t start, vaddr_t end) * install new vmspace and drop our ref to the old one. */ + kpreempt_disable(); pmap_deactivate(l); p->p_vmspace = nvm; pmap_activate(l); + kpreempt_enable(); uvmspace_free(ovm); }