From c87ad37e6155f604c444475b0237a4ec687d1e07 Mon Sep 17 00:00:00 2001 From: David Greenman Date: Sun, 17 Sep 1995 01:46:03 +0000 Subject: [PATCH] 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. --- sys/vm/vm_glue.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c index 62eaf5204722..4a2acba02841 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 @@ -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);