Subject: Re: SIR Reset with todays sources
To: Juergen Hannken-Illjes <hannken@eis.cs.tu-bs.de>
From: Eduardo Horvath <eeh@NetBSD.org>
List: port-sparc64
Date: 03/27/2007 15:24:43
On Mon, 26 Mar 2007, Juergen Hannken-Illjes wrote:

> Index: pmap.c
> ===================================================================
> RCS file: /cvsroot/src/sys/arch/sparc64/sparc64/pmap.c,v
> retrieving revision 1.187
> diff -p -u -2 -r1.187 pmap.c
> --- pmap.c	12 Mar 2007 18:18:28 -0000	1.187
> +++ pmap.c	26 Mar 2007 17:10:18 -0000
> @@ -1438,4 +1438,5 @@ pmap_activate_pmap(struct pmap *pmap)
>  	}
>  	stxa(CTX_SECONDARY, ASI_DMMU, pmap->pm_ctx);
> +	membar_sync();

The above code is not safe.  The compiler can schedule other instructions 
between the stxa and membar #Sync, which could cause the machine to crash.  
You should code this as a single __asm() which has the membar #Sync right 
after the stxa instruction, preventing the compiler from scheduling any 
other operations in between.

Eduardo