From 279eafd09f2514d288cf449bcb7edca19ea31d50 Mon Sep 17 00:00:00 2001 From: alc Date: Wed, 21 Jul 1999 18:02:27 +0000 Subject: Fix the following problem: When creating new processes (or performing exec), the new page directory is initialized too early. The kernel might grow before p_vmspace is initialized for the new process. Since pmap_growkernel doesn't yet know about the new page directory, it isn't updated, and subsequent use causes a failure. The fix is (1) to clear p_vmspace early, to stop pmap_growkernel from stomping on memory, and (2) to defer part of the initialization of new page directories until p_vmspace is initialized. PR: kern/12378 Submitted by: tegge Reviewed by: dfr --- sys/vm/vm_map.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sys/vm/vm_map.c') diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index cbe2a2d..bfebc9c 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -61,7 +61,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: vm_map.c,v 1.171 1999/07/01 19:53:41 peter Exp $ + * $Id: vm_map.c,v 1.172 1999/07/11 18:30:31 alc Exp $ */ /* @@ -2351,6 +2351,7 @@ vmspace_exec(struct proc *p) { */ vmspace_free(oldvmspace); p->p_vmspace = newvmspace; + pmap_pinit2(vmspace_pmap(newvmspace)); if (p == curproc) pmap_activate(p); } @@ -2370,6 +2371,7 @@ vmspace_unshare(struct proc *p) { newvmspace = vmspace_fork(oldvmspace); vmspace_free(oldvmspace); p->p_vmspace = newvmspace; + pmap_pinit2(vmspace_pmap(newvmspace)); if (p == curproc) pmap_activate(p); } -- cgit v1.1