提交 51061b88 编写于 作者: D Deng-Cheng Zhu 提交者: Ralf Baechle

MIPS: math-emu: Fix prefx detection and COP1X function field definition

When running applications which contain the instruction "prefx" on FPU-less
CPUs, a message "Illegal instruction" will be seen. This instruction is
supposed to be ignored by the FPU emulator. However, its current detection
and function field encoding are incorrect. This patch fix the issue.
Signed-off-by: NDeng-Cheng Zhu <dengcheng.zhu@imgtec.com>
Reviewed-by: NLeonid Yegoshin <Leonid.Yegoshin@imgtec.com>
Reviewed-by: NPaul Burton <paul.burton@imgtec.com>
Acked-by: NDavid Daney <david.daney@cavium.com>
Cc: linux-mips@linux-mips.org
Cc: Steven.Hill@imgtec.com
Patchwork: https://patchwork.linux-mips.org/patch/6608/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
上级 031365b4
...@@ -163,8 +163,8 @@ enum cop1_sdw_func { ...@@ -163,8 +163,8 @@ enum cop1_sdw_func {
*/ */
enum cop1x_func { enum cop1x_func {
lwxc1_op = 0x00, ldxc1_op = 0x01, lwxc1_op = 0x00, ldxc1_op = 0x01,
pfetch_op = 0x07, swxc1_op = 0x08, swxc1_op = 0x08, sdxc1_op = 0x09,
sdxc1_op = 0x09, madd_s_op = 0x20, pfetch_op = 0x0f, madd_s_op = 0x20,
madd_d_op = 0x21, madd_e_op = 0x22, madd_d_op = 0x21, madd_e_op = 0x22,
msub_s_op = 0x28, msub_d_op = 0x29, msub_s_op = 0x28, msub_d_op = 0x29,
msub_e_op = 0x2a, nmadd_s_op = 0x30, msub_e_op = 0x2a, nmadd_s_op = 0x30,
......
...@@ -1538,10 +1538,10 @@ static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, ...@@ -1538,10 +1538,10 @@ static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
break; break;
} }
case 0x7: /* 7 */ case 0x3:
if (MIPSInst_FUNC(ir) != pfetch_op) { if (MIPSInst_FUNC(ir) != pfetch_op)
return SIGILL; return SIGILL;
}
/* ignore prefx operation */ /* ignore prefx operation */
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册