wandboard / imx6 / exynos4 / cortex-a9 "wrong-endian bug" fixed

Tom Everett tom at khubla.com
Sun Feb 2 22:05:53 UTC 2014


This has been a problem on Wandboard for a long time.  Congrats on the fix!



On Sun, Feb 2, 2014 at 1:00 PM, Ian Lepore <ian at freebsd.org> wrote:

> As some of you know from previous email or irc conversations, I've been
> chasing a strange bug for months that affects some cortex-a9 chips,
> which I've been calling the "wrong-endian bug", where some registers get
> restored with wrong-endian values on return from an interrupt, leading
> to a panic or crash during boot.
>
> I finally tracked the cause down to our gnu assembler (gas), which
> apparently thinks that when you say "msr spsr_all, r0" what you meant by
> "_all" was "only restore 16 of the 32 bits".  It's not a bug per se,
> it's just how the gas authors think the assembler should behave.  So,
> when the chip powers on there may be some garbage bits in the spsr
> register, and they would never get cleared out because only some of the
> bits would get restored, and if the big-endian bit was among them Bad
> Things Happened.  I'm not sure why this only affected some cortex-a9
> chips such as imx6, but maybe some chips set those registers to zero and
> some don't at power-on.
>
> I fixed the problem by updating our source code to use the newer arm
> instruction syntax for msr and msr instructions, which ensures all 32
> bits get restored.  That change happened in r261393, but because of
> other changes and churn in the tree the first really stable revision
> that includes the fix is r261410.  So if you're working with wandboard
> or another imx6-based system, please make sure to update to this rev.
>
> -- Ian
>
>
>


-- 
A better world shall emerge based on faith and understanding  - Douglas
MacArthur


More information about the freebsd-arm mailing list