Skip to content

Commit b332fec

Browse files
mpredfearnralfbaechle
authored andcommitted
MIPS: microMIPS: Fix detection of addiusp instruction
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: 34c2f66 ("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>
1 parent 11887ed commit b332fec

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎arch/mips/kernel/process.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ static inline int is_sp_move_ins(union mips_instruction *ip)
326326
*/
327327
if (mm_insn_16bit(ip->halfword[1])) {
328328
return (ip->mm16_r3_format.opcode == mm_pool16d_op &&
329-
ip->mm16_r3_format.simmediate && mm_addiusp_func) ||
329+
ip->mm16_r3_format.simmediate & mm_addiusp_func) ||
330330
(ip->mm16_r5_format.opcode == mm_pool16d_op &&
331331
ip->mm16_r5_format.rt == 29);
332332
}

0 commit comments

Comments
 (0)