[OpenBIOS] [PATCH] SPARC32 : WIM register update delay

Blue Swirl blauwirbel at gmail.com
Fri Jan 25 18:16:06 CET 2013


On Tue, Jan 22, 2013 at 9:33 PM, Olivier DANET <odanet at caramail.com> wrote:
> The SparcV8 standard states, page 134 :
> "If any of the three instructions after a write state register instruction reads any field
>  that was changed by the original write state register instruction, the contents of that
>  field read by that instruction are undefined."
> The restore instruction depends on the %WIM register, three NOPs must be inserted.
>

Please put the SoB here.

> diff a/openbios-devel/arch/sparc32/wuf.S b/openbios-devel/arch/sparc32/wuf.S
> --- a/openbios-devel/arch/sparc32/wuf.S
> +++ b/openbios-devel/arch/sparc32/wuf.S
> @@ -121,7 +121,7 @@ fnwin_patch1:       srl     %t_wim, 7, %twin_tmp2
>  fnwin_patch2:  and     %twin_tmp1, 0xff, %twin_tmp1
>
>         wr      %twin_tmp1, 0x0, %wim   /* Make window 'I' invalid */
> -
> +    WRITE_PAUSE

As you cite, this is needed on real HW. QEMU does not need it since
internal pipelines are not modeled. Perhaps this (or the definition of
WRITE_PAUSE) should be surrounded by
#ifndef CONFIG_QEMU
#endif

Anyway, TCG optimizes the nops away so it doesn't matter.

>         restore %g0, %g0, %g0           /* Restore to window 'O' */
>
>         /* Trapped from kernel, we trust that the kernel does not
>
> Signed-off-by: Olivier DANET <odanet at caramail.com>



More information about the OpenBIOS mailing list