On 29 May 2014 20:46, Paolo Bonzini <pbonz...@redhat.com> wrote: > Now that CPSR.E is set correctly, prepare for when setend will be able > to change it; bswap data in and out of strex manually by comparing > bswap_code to CPSR.E (we do not have the luxury of using TCGMemOps). > > Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> > --- > linux-user/main.c | 50 +++++++++++++++++++++++++++++++++++++++++++------- > 1 file changed, 43 insertions(+), 7 deletions(-) > > diff --git a/linux-user/main.c b/linux-user/main.c > index 8eb910a..b129a2b 100644 > --- a/linux-user/main.c > +++ b/linux-user/main.c > @@ -449,6 +449,38 @@ void cpu_loop(CPUX86State *env) > __r; \ > }) > > +#define get_user_data_u32(x, gaddr, env) \ > + ({ abi_long __r = get_user_u32((x), (gaddr)); \ > + if (!__r && (env)->bswap_code != !!((env)->uncached_cpsr & CPSR_E)) > { \ > + (x) = bswap32(x); \ > + } \ > + __r; \ > + })
This looks bogus. bswap_code doesn't have anything to do with whether data should be byteswapped. Consider the ARMv5 big-endian code, which qemu-armeb also supports: there both code and data are big-endian, and bswap_code is false. bswap_code should only be consulted for iside accesses. thanks -- PMM