qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH for-2.1] target-arm: Fix bit test in sp_el0_acce


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH for-2.1] target-arm: Fix bit test in sp_el0_access
Date: Fri, 1 Aug 2014 16:53:41 +0100

On 26 July 2014 08:26, Stefan Weil <address@hidden> wrote:
> Static code analyzers complain about a dubious & operation used for a
> boolean value. The code does not test the PSTATE_SP bit as it should.
>
> Cc: Peter Maydell <address@hidden>
> Signed-off-by: Stefan Weil <address@hidden>
> ---
>
> Hello Peter,
>
> I'm not sure whether the "!" is correct at all, because code and comment
> don't seem to match. But I am not an ARM expert, so please review.
>
> Thanks,
> Stefan
>
>  target-arm/helper.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target-arm/helper.c b/target-arm/helper.c
> index d343856..6ecaa61 100644
> --- a/target-arm/helper.c
> +++ b/target-arm/helper.c
> @@ -1853,7 +1853,7 @@ static uint64_t aa64_dczid_read(CPUARMState *env, const 
> ARMCPRegInfo *ri)
>
>  static CPAccessResult sp_el0_access(CPUARMState *env, const ARMCPRegInfo *ri)
>  {
> -    if (!env->pstate & PSTATE_SP) {
> +    if (!(env->pstate & PSTATE_SP)) {
>          /* Access to SP_EL0 is undefined if it's being used as
>           * the stack pointer.
>           */
> --

Applied to target-arm.next.

thanks
-- PMM



reply via email to

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