On 30 May 2014 07:46, Paolo Bonzini <pbonz...@redhat.com> wrote: > Il 29/05/2014 22:38, Peter Maydell ha scritto: > >>> > +#ifdef TARGET_WORDS_BIGENDIAN >>> > + cpsr |= CPSR_E; >> >> This is wrong for BE32, where CPSR_E doesn't exist and both code >> and data accesses are big-endian. >> > > Is it okay for simplicity to treat CPSR.E = 1 as "big-endian code, > little-endian data" in BE32 mode? The architecture manual leaves it > undefined.
Actually the ARM ARM does define it: (DDI0406C.c section D12.6.1) "When SCTLR.B is set, SCTLR.EE and CPSR.E must be clear, or else the endianness behaviour is UNPREDICTABLE." So if the guest does set CPSR.E in a BE32 binary you can do whatever's convenient as long as it's not a security hole, basically. thanks -- PMM