diff options
author | Matt Redfearn <matt.redfearn@imgtec.com> | 2017-08-08 13:22:31 +0100 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2017-11-26 13:50:32 +0000 |
commit | ad0fa9970ba9ac5746c10d1c5c44143742e59c97 (patch) | |
tree | 107d04a39095346110b8b0466644879cc3465850 /arch/mips | |
parent | f501a7822c36a0dad5142c0780c7f3135681e232 (diff) |
MIPS: microMIPS: Fix detection of addiusp instruction
commit b332fec0489295ee7a0aab4a89bd7257cd126f7f upstream.
The addiusp instruction uses the pool16d opcode, with bit 0 of the
immediate set. The test for the addiusp opcode erroneously did a logical
and of the immediate with mm_addiusp_func, which has value 1, so this
test always passes when the immediate is non-zero.
Fix the test by replacing the logical and with a bitwise and.
Fixes: 34c2f668d0f6 ("MIPS: microMIPS: Add unaligned access support.")
Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
Cc: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/16954/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/kernel/process.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c index 68c88fee9a31..fdbe09441bb0 100644 --- a/arch/mips/kernel/process.c +++ b/arch/mips/kernel/process.c @@ -353,7 +353,7 @@ static inline int is_sp_move_ins(union mips_instruction *ip) */ if (mm_insn_16bit(ip->halfword[1])) { return (ip->mm16_r3_format.opcode == mm_pool16d_op && - ip->mm16_r3_format.simmediate && mm_addiusp_func) || + ip->mm16_r3_format.simmediate & mm_addiusp_func) || (ip->mm16_r5_format.opcode == mm_pool16d_op && ip->mm16_r5_format.rt == 29); } |