[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 2/8] linux-user: arm: set CPSR.E correctly fo
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH v2 2/8] linux-user: arm: set CPSR.E correctly for BE8 mode |
Date: |
Fri, 30 May 2014 09:26:22 +0100 |
On 30 May 2014 07:46, Paolo Bonzini <address@hidden> 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
- [Qemu-devel] [PATCH v2 0/8] target-arm/linux-user-arm: implement setend, CPSR.E, SCTLR.EE, Paolo Bonzini, 2014/05/29
- [Qemu-devel] [PATCH v2 4/8] linux-user: arm: handle CPSR.E correctly in strex emulation, Paolo Bonzini, 2014/05/29
- [Qemu-devel] [PATCH v2 3/8] linux-user: arm: pass env to get_user_code_*, Paolo Bonzini, 2014/05/29
- [Qemu-devel] [PATCH v2 6/8] target-arm: pass DisasContext to gen_aa32_ld*/st*, Paolo Bonzini, 2014/05/29
- [Qemu-devel] [PATCH v2 7/8] target-arm: introduce be8 tbflag, Paolo Bonzini, 2014/05/29
- [Qemu-devel] [PATCH v2 8/8] target-arm: implement setend, Paolo Bonzini, 2014/05/29