From: Fabien Chouteau <chouteau@adacore.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Paul Brook <paul@codesourcery.com>,
afaerber@suse.de, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 4/4] target-arm: always set endian bits in big-endian mode
Date: Wed, 06 Mar 2013 18:39:16 +0100 [thread overview]
Message-ID: <51377F44.3020309@adacore.com> (raw)
In-Reply-To: <CAFEAcA82tw8SNUEUHNPLwdOT3w6CFoTv-sBnPiXg_EPcqjxgVA@mail.gmail.com>
On 03/06/2013 12:08 AM, Peter Maydell wrote:
> On 5 March 2013 23:07, Fabien Chouteau <chouteau@adacore.com> wrote:
>> On 03/05/2013 01:33 PM, Peter Maydell wrote:
>>> IE + BE8 (data) looks very very similar to BE32 from the point of view
>>> of code on the CPU; it is code that expects a BE32 kind of view of
>>> the world that is the legacy code being supported.
>>>
>>
>> That's what I fail to understand, why IE + BE8 (data) gives a legacy
>> BE32 view?
>
> Because the only way to tell the difference between BE32 and BE8
> is if you have two views of the data in memory, so you can tell
> whether it's the byte accesses that are getting flipped or the
> word accesses. Those two views could be:
> * via the Iside vs the Dside [but with IE enabled both get flipped]
> * by switching the core between BE and LE [you can't on R profile]
> * by using another core which is LE [there is none]
> * by looking at what peripheral devices see when you write words
> to them [the legacy code is assumed not to have direct dev access,
> or you could design your board so it looks like what the code
> expects]
Alright I get it. It looks similar to legacy BE32 because both
instruction and data use the same byte order. From the code point of
view it's the same, but in fact the data in RAM are different.
>>>> When I build my qemu-system-armeb, in what mode is it (BE8, BE32, data
>>>> and/or instruction in big-endian)?
>>>
>>> It will effectively behave kind of like a BE32 (word invariant, swaps
>>> both code and data) system; you won't be able to tell the difference
>>> between that and the BE8+SCTLR.IE system you're trying to emulate,
>>> except for accesses to word-width registers on device models.
>>> That needs thought to make sure the changes are actually coherent.
>>>
>>
>> So the current behavior of qemu-system-armeb is BE8+IE, therefore not
>> compatible with any non R profile ARMv6/7.
>
> Well, the current behaviour is nothing at all since we don't
> actually build it. In enabling it, you have to ensure that
> the behaviour you enable makes sense.
>
It makes sense for me, as I have the same executable working on the real
board (TMS570L31, Cortex-R4F BE-8 + IE) and on qemu-system-armeb. In the
3 devices I implemented (Memory region in DEVICE_NATIVE_ENDIAN), I had
no byte ordering problems.
Regards,
--
Fabien Chouteau
prev parent reply other threads:[~2013-03-06 17:39 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-01 17:21 [Qemu-devel] [PATCH 0/4] ARM: Misc ARM big-endian bug fixes Fabien Chouteau
2013-03-01 17:21 ` [Qemu-devel] [PATCH 1/4] QAPI: Add ARMEB target-type Fabien Chouteau
2013-03-01 17:21 ` [Qemu-devel] [PATCH 2/4] Add default config for armeb-softmmu Fabien Chouteau
2013-03-01 17:21 ` [Qemu-devel] [PATCH 3/4] target-arm: Fix VFP register byte order in GDB remote Fabien Chouteau
2013-03-01 20:51 ` Paul Brook
2013-03-04 10:03 ` Fabien Chouteau
2013-03-04 13:30 ` Paul Brook
2013-03-04 17:31 ` Fabien Chouteau
[not found] ` <201303042334.02147.paul@codesourcery.com>
2013-03-05 10:59 ` Fabien Chouteau
2013-03-01 17:21 ` [Qemu-devel] [PATCH 4/4] target-arm: always set endian bits in big-endian mode Fabien Chouteau
2013-03-01 20:58 ` Paul Brook
2013-03-04 10:30 ` Fabien Chouteau
2013-03-04 13:24 ` Paul Brook
2013-03-05 10:56 ` Fabien Chouteau
2013-03-05 12:33 ` Peter Maydell
2013-03-05 15:07 ` Fabien Chouteau
2013-03-05 23:08 ` Peter Maydell
2013-03-06 17:39 ` Fabien Chouteau [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51377F44.3020309@adacore.com \
--to=chouteau@adacore.com \
--cc=afaerber@suse.de \
--cc=paul@codesourcery.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).