qemu-devel
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]