[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 4/8] linux-user: arm: handle CPSR.E correctly
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH v2 4/8] linux-user: arm: handle CPSR.E correctly in strex emulation |
Date: |
Thu, 29 May 2014 21:21:20 +0100 |
On 29 May 2014 20:46, Paolo Bonzini <address@hidden> 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 <address@hidden>
> ---
> 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
- [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 1/8] linux-user: arm: fix coding style for some linux-user signal functions, Paolo Bonzini, 2014/05/29
- [Qemu-devel] [PATCH v2 5/8] target-arm: implement SCTLR.EE, Paolo Bonzini, 2014/05/29
- [Qemu-devel] [PATCH v2 2/8] linux-user: arm: set CPSR.E correctly for BE8 mode, 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
- Re: [Qemu-devel] [PATCH v2 4/8] linux-user: arm: handle CPSR.E correctly in strex emulation,
Peter Maydell <=
- [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