summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_glue.c
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1995-09-17 01:46:03 +0000
committerdg <dg@FreeBSD.org>1995-09-17 01:46:03 +0000
commit1388e34c46da5eb9cff130906a378a756078688b (patch)
treea42dda40d4745a49c008b64a5657271ee1e9eb94 /sys/vm/vm_glue.c
parentde534c054e8d7e4712bba5dba2d397e52088feaf (diff)
downloadFreeBSD-src-1388e34c46da5eb9cff130906a378a756078688b.zip
FreeBSD-src-1388e34c46da5eb9cff130906a378a756078688b.tar.gz
Check the return value from vm_map_pageable() when mapping the process's
UPAGES and associated page table page. Panic on error. This is less than optimial and will be fixed in the future, but is better than the old behavior of panicing with a "kernel page directory invalid" in pmap_enter.
Diffstat (limited to 'sys/vm/vm_glue.c')
-rw-r--r--sys/vm/vm_glue.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c
index 62eaf52..4a2acba 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.24 1995/08/28 09:19:22 julian Exp $
+ * $Id: vm_glue.c,v 1.25 1995/09/09 18:10:35 davidg Exp $
*/
#include <sys/param.h>
@@ -200,7 +200,7 @@ vm_fork(p1, p2, isvfork)
{
register struct user *up;
vm_offset_t addr, ptaddr;
- int i;
+ int error, i;
struct vm_map *vp;
while ((cnt.v_free_count + cnt.v_cache_count) < cnt.v_free_min) {
@@ -235,10 +235,14 @@ vm_fork(p1, p2, isvfork)
/* force in the page table encompassing the UPAGES */
ptaddr = trunc_page((u_int) vtopte(addr));
- vm_map_pageable(vp, ptaddr, ptaddr + NBPG, FALSE);
+ error = vm_map_pageable(vp, ptaddr, ptaddr + NBPG, FALSE);
+ if (error)
+ panic("vm_fork: wire of PT failed. error=%d", error);
/* and force in (demand-zero) the UPAGES */
- vm_map_pageable(vp, addr, addr + UPAGES * NBPG, FALSE);
+ error = vm_map_pageable(vp, addr, addr + UPAGES * NBPG, FALSE);
+ if (error)
+ panic("vm_fork: wire of UPAGES failed. error=%d", error);
/* get a kernel virtual address for the UPAGES for this proc */
up = (struct user *) kmem_alloc_pageable(u_map, UPAGES * NBPG);
OpenPOWER on IntegriCloud