Subject: Re: -current TLB panics on 3100?
To: Michael L. Hitch <mhitch@lightning.msu.montana.edu>
From: William O Ferry <woferry@iname.com>
List: port-pmax
Date: 11/07/1999 13:59:24
"Michael L. Hitch" writes:
>  Is this a GENERIC, or custom kernel?

	It's custom, based on GENERIC with most non-3100 features commented out.

>  Try doing "x/i 0x8014b60,10" at the DDB prompt - that should display
>some of the code around that execption.

	I'm assuming you meant "0x8014b600,10", the command above causes another trap.

trap: TLB miss (load or instr. fetch) in kernel mode
status=0x8fc34, cause=0x30000000, epc=0x8014b628, vaddr=0x100
pid=148 cmd=named usp=0x7ffffad0 ksp=0xc2145e90
Stopped in named at     trap+0x2f4:     lw      a2,0(v1)
db> x/i 0x8014b600,10
trap+0x2cc:	move	a0,a2
trap+0x2d0:	j	<trap+7d8>	[addr:0x8014bb0c]
trap+0x2d4:	nop
trap+0x2d8:	lw	a0,36(s2)
trap+0x2dc:	lw	t5,80(sp)
trap+0x2e0:	lw	a1,0(a0)
trap+0x2e4:	srl	v0,t5,22
trap+0x2e8:	lw	v1,24(a1)
trap+0x2ec:	sll	v0,v0,2
trap+0x2f0:	addu	v1,v1,v0
trap+0x2f4:	lw	a2,0(v1)
trap+0x2f8:	nop
trap+0x2fc:	bne	a2,zero,<trap+310>	[addr:0x8014b644]
trap+0x300:	srl	v0,t5,12
trap+0x304:	lui	a0,0x8018
trap+0x308:	jal	panic	[addr:0x8006283c]

>  If this is where I think it is, it looks like the kernel is processing a
>user TLB modify exception [pmap has set the page to read-only, and uses
>the TLBmod exception to emulate page-modification status].  The kernel
>TLB miss appears to be occuring when the TLBmod exception handler is
>trying to load the first-level page table entry.
>
>                pmap  = p->p_vmspace->vm_map.pmap;
>                if (!(pte = pmap_segmap(pmap, vaddr)))
>                            ^^^^^^^^^^^^^^^^^^^^^^^
>This is where I think the kernel exception is occuring.
>
>                        panic("utlbmod: invalid segmap");
>                pte += (vaddr >> PGSHIFT) & (NPTEPG - 1);
>                entry = pte->pt_entry;
>
>  You could put a check just before the if statement to see if pmap is
>NULL, and if it's not NULL, check pmap->pm_segtab for NULL.

	I threw in the printfs, they showed (1 out of 1 try) that pmap was not NULL, 
but pmap->pm_segtab was.

	Hope that helps.  Thanks! 


                                                          Will Ferry

-----------------
woferry@iname.com