Date: Thu, 8 Jan 1998 04:26:52 GMT From: Luoqi Chen <luoqi@luoqi.watermarkgroup.com> To: FreeBSD-gnats-submit@FreeBSD.ORG Subject: kern/5458: page fault during proc0 init & fix Message-ID: <199801080426.EAA04228@luoqi.watermarkgroup.com> Resent-Message-ID: <199801082233.OAA10010@hub.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 5458 >Category: kern >Synopsis: page fault in proc0_init() & fix >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Jan 8 14:33:17 PST 1998 >Last-Modified: >Originator: Luoqi Chen >Organization: The Watermark Group >Release: FreeBSD 3.0-CURRENT i386 >Environment: UP kernel cvsupped as of 1/7/1998 >Description: When pmap_pinit0() allocates a page for proc0's page directory, kernal page table may need to be extended. But while growing the kernel page table (pmap_growkernel()), newly allocated kernel page table pages are entered into every process' page directory. For proc0, the page directory is not allocated yet, and results in a page fault. Eventually, the machine panics with "lockmgr: not holding exclusive lock". >How-To-Repeat: Not sure. >Fix: In init_main.c:proc0_init(), move the call to pmap_pinit0() two lines up, right before proc0->p_vmspace is set. Because vmspace is not set, proc0 will be skipped when growing kernel page table. Index: init_main.c =================================================================== RCS file: /fun/cvs/src/sys/kern/init_main.c,v retrieving revision 1.79 diff -u -r1.79 init_main.c --- init_main.c 1997/12/14 02:10:12 1.79 +++ init_main.c 1998/01/08 07:14:29 @@ -399,9 +399,9 @@ limit0.p_refcnt = 1; /* Allocate a prototype map so we have something to fork. */ + pmap_pinit0(&vmspace0.vm_pmap); p->p_vmspace = &vmspace0; vmspace0.vm_refcnt = 1; - pmap_pinit0(&vmspace0.vm_pmap); vm_map_init(&vmspace0.vm_map, round_page(VM_MIN_ADDRESS), trunc_page(VM_MAXUSER_ADDRESS), TRUE); vmspace0.vm_map.pmap = &vmspace0.vm_pmap; >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199801080426.EAA04228>