diff options
author | alc <alc@FreeBSD.org> | 1999-07-21 18:02:27 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 1999-07-21 18:02:27 +0000 |
commit | 279eafd09f2514d288cf449bcb7edca19ea31d50 (patch) | |
tree | 2b71e9fdd68c718169f98753b2d8da9e09b69bf8 /sys/vm/vm_glue.c | |
parent | cd7ecc6fc022e270d89e62000744e4a6d41d0465 (diff) | |
download | FreeBSD-src-279eafd09f2514d288cf449bcb7edca19ea31d50.zip FreeBSD-src-279eafd09f2514d288cf449bcb7edca19ea31d50.tar.gz |
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
Diffstat (limited to 'sys/vm/vm_glue.c')
-rw-r--r-- | sys/vm/vm_glue.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c index 5221e18..2577686 100644 --- a/sys/vm/vm_glue.c +++ b/sys/vm/vm_glue.c @@ -59,7 +59,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: vm_glue.c,v 1.85 1999/04/06 03:11:34 peter Exp $ + * $Id: vm_glue.c,v 1.86 1999/06/19 18:42:49 alc Exp $ */ #include "opt_rlimit.h" @@ -226,6 +226,8 @@ vm_fork(p1, p2, flags) if ((flags & RFMEM) == 0) { p2->p_vmspace = vmspace_fork(p1->p_vmspace); + pmap_pinit2(vmspace_pmap(p2->p_vmspace)); + if (p1->p_vmspace->vm_shm) shmfork(p1, p2); } |