target-arm/helper.c:5493: bad test ?

Bug #1550503 reported by dcb
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QEMU
Fix Released
Undecided
Unassigned

Bug Description

[qemu/target-arm/helper.c:5493]: (style) Expression '(X & 0x1f) != 0xf80f0000' is always true.

Source code is

        (env->uncached_cpsr & CPSR_M) != CPSR_USER &&

but

./qemu/target-arm/cpu.h:#define CPSR_M (0x1fU)

./qemu/target-arm/cpu.h:#define CPSR_USER (CPSR_NZCV | CPSR_Q | CPSR_GE)

Revision history for this message
Peter Maydell (pmaydell) wrote : Re: [Qemu-devel] [Bug 1550503] [NEW] target-arm/helper.c:5493: bad test ?

On 26 February 2016 at 20:07, dcb <email address hidden> wrote:
> Public bug reported:
>
> [qemu/target-arm/helper.c:5493]: (style) Expression '(X & 0x1f) !=
> 0xf80f0000' is always true.
>
> Source code is
>
> (env->uncached_cpsr & CPSR_M) != CPSR_USER &&
>
> but
>
> ./qemu/target-arm/cpu.h:#define CPSR_M (0x1fU)
>
> ./qemu/target-arm/cpu.h:#define CPSR_USER (CPSR_NZCV | CPSR_Q | CPSR_GE)

Yeah, that's a bug. Should be ARM_CPU_MODE_USR, not CPSR_USER.

thanks
-- PMM

Revision history for this message
Peter Maydell (pmaydell) wrote :
Changed in qemu:
status: New → In Progress
Revision history for this message
Thomas Huth (th-huth) wrote :

Fix should be part of QEMU v2.6.0:
http://git.qemu.org/?p=qemu.git;a=commit;h=8c4f0eb94cc65ee32a
... so I think this ticket can now be closed.

Changed in qemu:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.