Subject: Re: 2.0 kernel crash
To: ali (Anders Lindgren) <dat94ali@ludat.lth.se>
From: Chuck Silvers <chuq@chuq.com>
List: port-sparc64
Date: 12/05/2004 09:07:35
--LQksG6bCIzRHxTLp
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

you need to apply the attached patch (which unfortunately didn't make it
into the 2.0 release).

the "switching with held simple_lock" messages are due to you having
invoked "reboot" from within a panic.  if you want to avoid it
just turn off LOCKDEBUG in your kernel (which isn't much use on sparc64
anyway since we don't have MP yet there).

-Chuck


On Sun, Dec 05, 2004 at 04:26:39PM +0100, ali (Anders Lindgren) wrote:
>   On the odd chance this is of help to anyone...
> 
>   Just updated my 2.0_RC5 system to 2.0 with build.sh as per normal
> procedure, installed kernel, rebooted and installed the distribution to /
> and rebooted, and all seemed fine. Then I realized I should probably build
> a release while I was at it, for burning a CD to bring home. To avoid
> rebuilding the entire system I did a build.sh -u -M [....] tools release.
> Checking back this afternoon I find the machine has:
> 
> db> bt
> uvm_anfree(603c228, 11bc400, 1c68bf0, 8000000010784632, ffffffffffffffff, 1810000) at netbsd:uvm_anfree+0xb8
> amap_wipeout(603c220, 0, 9, 0, 3fffff, 11cac00) at netbsd:amap_wipeout+0xf8
> uvm_unmap_detach(6091e90, 0, ffffffffffffffff, 5ed7ae8, 13f, ed2) at netbsd:uvm_unmap_detach+0x160
> uvmspace_free(6445740, 0, 0, 1, badcafe, badcafe) at netbsd:uvmspace_free+0xe0
> exit1(6460710, 0, 40222180, ffffffffffffce68, 1, 12) at netbsd:exit1+0x308
> sys_exit(0, 5ed7dd0, 5ed7dc0, 1, 9182008202, 0) at netbsd:sys_exit+0x3c
> syscall(5ed7ed0, 1, 409310ec, 800, 1814800, 0) at netbsd:syscall+0x32c
> ?(0, 0, 11d400, 220400, 4, 1) at 0x1009614
> 
> and:
...
> 
> Unfortunately, I don't have the original panic message that would
> have preceeded the "db>" prompt, because I wasn't logged in at the machine
> acting as serial console for this machine at the time (and the machine
> doesn't have screen(1) installed a.t.m).
> 
> Rebooting from the db> prompt works a lot better than during pthread
> ("ltsleep)" panics and I got some gcc/make output when I did it:
> 
> db> reboot
> syncing disks... hme0: status=30003<GOTFRAME,RCNTEXP,RXTOHOST,NORXD>
> e.
> `inode.o' is up to date.
> `main.
> switching with held simple_lock 0x603c228 CPU 0
> /usr/src/sys/uvm/uvm_anon.c:242
...

--LQksG6bCIzRHxTLp
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="diff.sparc64-pmap.2"

Index: src/sys/arch/sparc64/sparc64/pmap.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc64/sparc64/pmap.c,v
retrieving revision 1.156
diff -u -p -r1.156 pmap.c
--- src/sys/arch/sparc64/sparc64/pmap.c	21 Mar 2004 14:19:30 -0000	1.156
+++ src/sys/arch/sparc64/sparc64/pmap.c	30 Nov 2004 11:13:25 -0000
@@ -2077,6 +2077,7 @@ pmap_remove_all(pm)
 	stxa(CTX_SECONDARY, ASI_DMMU, 0);
 	pm->pm_refs = 0;
 	ctx_free(pm);
+	blast_dcache();
 }
 
 /*
@@ -3136,7 +3137,6 @@ ctx_alloc(pm)
 			}
 		}
 		tlb_flush_all();
-		blast_dcache();
 		ctx = 1;
 		pmap_next_ctx = 2;
 	}

--LQksG6bCIzRHxTLp--