Subject: Re: SIR Reset with todays sources
To: Martin Husemann <martin@duskware.de>
From: Eduardo Horvath <eeh@NetBSD.org>
List: port-sparc64
Date: 03/26/2007 16:18:28
On Sun, 25 Mar 2007, Martin Husemann wrote:
> On Sun, Mar 25, 2007 at 08:59:31PM +0200, Martin Husemann wrote:
> > But changing the one in pmap_remove_all to set the secondary context to
> > -1 instead of 0 does the trick.
>
> On second thought: removing that stxa(CTX_SECONDARY, ASI_DMMU, 0) completely
> does the trick too.
>
> I'm not sure there could be any data accesses happening between this and the
> removal of the mapping in pmap_remove(), and if those would happen, if still
> allowing them would be evil. I suppose we can ignore this.
What the heck are we trying to do here? Setting the secondary context to
0 merely makes user accesses (ASI_AIUS) use the kernel pmap, which means
you are allowing the kernel to trash itself, which is bogus. Also, if
code tries to flush the secondary context out of the MMU it will flush out
he nucleus (kernel) context instead of whatever user context used to be
there. What Chuck may have been trying to do there is flush the secondary
context, which is probably best done by calling sp_tlb_flush_ctx() in
locore.s, which, in theory, should DTRT. (What's going on in the
non-spitfire code? He's demapping the entire nucleus context? It really
hurts to look at this stuff. Sigh.)
Eduardo