Subject: panic
To: None <Herve.Soulard@inria.fr>
From: Gordon W. Ross <gwr@mc.com>
List: port-sun3
Date: 02/09/1995 11:35:53
> From: Herve Soulard <Herve.Soulard@inria.fr>
> Date: Thu, 9 Feb 1995 10:56:34 +0100
> Sender: owner-port-sun3@netbsd.org
> Precedence: list
> X-Loop: port-sun3@NetBSD.ORG
> 
> 
> Hi,
> 
> I've just installed the NetBSD port to SUN3 with the netbsd-gen
> kernel. When the kernel boots it panics with the following messages:
> 
> NetBSD 1.0A (Generic) #137: Tue Jan 24 00:24:19 EST 1995
> gwr@saturn2: /home/gwr/netbsd/src/sys/arch/sun3/compile/GENERIC
> 
> Model: sun3/60
> Real mem: 20955136
> Avail mem: 18898944
[...]
> le0 at obctl0 addr 0x120000 level 3
> 	panic: pmap: pa_to_pvp: bad pa=0x1f800000
> Stopped at _Debugger+0x6: unlk a6
> 
> What should I do now ?

That happens because the PROM is leaving some pages mapped in DVMA
space, and the pmap code requires its VA space to start out clean.

The startup code is supposed to kill all such unwanted pmegs,
but I was having a problem with DVMA space at one time.
The following fix should take care of it.
I'll update the netbsd-gen kernel again.

Gordon


*** sun3_startup.c.~1~	Tue Feb  7 06:14:28 1995
--- sun3_startup.c	Thu Feb  9 11:19:25 1995
***************
*** 408,424 ****
  	}
  
  	/*
! 	 * XXX - Record pmegs in use by DVMA segment.
! 	 * I would have preferred to just nuke these, but that
! 	 * made the kernel die before we even get to consinit.
! 	 * Instead, there is a hack in pmap_enter_kernel (sigh)
! 	 * XXX - Should figure out how to kill these...
  	 */
  	va = sun3_trunc_seg(DVMA_SPACE_START);
  	while (va < DVMA_SPACE_END) {
! 		sme = get_segmap(va);
! 		if (sme != SEGINV)
! 			sun3_reserve_pmeg(sme);
  		va += NBSG;
  	}
  
--- 408,418 ----
  	}
  
  	/*
! 	 * Unmap pmegs left in DVMA space by the PROM.
  	 */
  	va = sun3_trunc_seg(DVMA_SPACE_START);
  	while (va < DVMA_SPACE_END) {
! 		set_segmap(va, SEGINV);
  		va += NBSG;
  	}