Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Feb 2014 14:41:40 -0700
From:      Tom Everett <tom@khubla.com>
To:        Ian Lepore <ian@freebsd.org>
Cc:        freebsd-arm <freebsd-arm@freebsd.org>, Bernd Walter <ticso@cicely7.cicely.de>
Subject:   Re: wandboard / imx6 / exynos4 / cortex-a9 "wrong-endian bug" fixed
Message-ID:  <CAB3ij4DhCjOvmy%2B9gUd7G3u25MdK79hbH7BgVuZQoQ3=5phAPQ@mail.gmail.com>
In-Reply-To: <1391371204.13026.43.camel@revolution.hippie.lan>
References:  <1391371204.13026.43.camel@revolution.hippie.lan>

next in thread | previous in thread | raw e-mail | index | archive | help
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@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAB3ij4DhCjOvmy%2B9gUd7G3u25MdK79hbH7BgVuZQoQ3=5phAPQ>