summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_glue.c
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1996-01-29 12:10:30 +0000
committerdg <dg@FreeBSD.org>1996-01-29 12:10:30 +0000
commitf13dc7b99803db08f1f3bea5f3dd751a3bae938e (patch)
tree158cb908e945bb8d36e7eaf0761ffe06c6c467c1 /sys/vm/vm_glue.c
parent33311f68ed38927b533fee23f40e97913c8f372b (diff)
downloadFreeBSD-src-f13dc7b99803db08f1f3bea5f3dd751a3bae938e.zip
FreeBSD-src-f13dc7b99803db08f1f3bea5f3dd751a3bae938e.tar.gz
Added a check/panic for vm_map_find failing to find space for the page
tables/u-pages when forking. This is a "can't happen" case. :-)
Diffstat (limited to 'sys/vm/vm_glue.c')
-rw-r--r--sys/vm/vm_glue.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c
index 2642343..22bda4f 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.36 1996/01/19 03:59:46 dyson Exp $
+ * $Id: vm_glue.c,v 1.37 1996/01/25 07:15:40 phk Exp $
*/
#include "opt_sysvipc.h"
@@ -217,7 +217,7 @@ vm_fork(p1, p2, isvfork)
register struct user *up;
vm_offset_t addr, ptaddr, ptpa;
int error, i;
- vm_map_t vp;
+ vm_map_t map;
pmap_t pvp;
vm_page_t stkm;
@@ -246,12 +246,14 @@ vm_fork(p1, p2, isvfork)
addr = (vm_offset_t) kstack;
- vp = &p2->p_vmspace->vm_map;
+ map = &p2->p_vmspace->vm_map;
pvp = &p2->p_vmspace->vm_pmap;
/* get new pagetables and kernel stack */
- (void) vm_map_find(vp, NULL, 0, &addr, UPT_MAX_ADDRESS - addr, FALSE,
+ error = vm_map_find(map, NULL, 0, &addr, UPT_MAX_ADDRESS - addr, FALSE,
VM_PROT_ALL, VM_PROT_ALL, 0);
+ if (error != KERN_SUCCESS)
+ panic("vm_fork: vm_map_find failed, addr=0x%x, error=%d", addr, error);
/* get a kernel virtual address for the UPAGES for this proc */
up = (struct user *) kmem_alloc_pageable(u_map, UPAGES * PAGE_SIZE);
@@ -262,7 +264,7 @@ vm_fork(p1, p2, isvfork)
UPAGES);
ptaddr = trunc_page((u_int) vtopte(kstack));
- (void) vm_fault(vp, ptaddr, VM_PROT_READ|VM_PROT_WRITE, FALSE);
+ (void) vm_fault(map, ptaddr, VM_PROT_READ|VM_PROT_WRITE, FALSE);
ptpa = pmap_extract(pvp, ptaddr);
if (ptpa == 0) {
panic("vm_fork: no pte for UPAGES");
OpenPOWER on IntegriCloud