riscv: correct riscv_insn_is_c_jr() and riscv_insn_is_c_jalr()
[ Upstream commit 79bc3f85 ] The instructions c.jr and c.jalr must have rs1 != 0, but riscv_insn_is_c_jr() and riscv_insn_is_c_jalr() do not check for this. So, riscv_insn_is_c_jr() can match a reserved encoding, while riscv_insn_is_c_jalr() can match the c.ebreak instruction. Rewrite them with check for rs1 != 0. Signed-off-by:Nam Cao <namcaov@gmail.com> Reviewed-by:
Charlie Jenkins <charlie@rivosinc.com> Fixes: ec5f9087 ("RISC-V: Move riscv_insn_is_* macros into a common header") Link: https://lore.kernel.org/r/20230731183925.152145-1-namcaov@gmail.com Signed-off-by:
Palmer Dabbelt <palmer@rivosinc.com> Signed-off-by:
Sasha Levin <sashal@kernel.org>
Loading
Please register or sign in to comment