提交 ba02946a 编写于 作者: K Kumar Gala

[POWERPC] Fix handling of stfiwx math emulation

Its legal for the stfiwx instruction to have RA = 0 as part of its
effective address calculation.  This is illegal for all other XE
form instructions.

Add code to compute the proper effective address for stfiwx if
RA = 0 rather than treating it as illegal.
Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
上级 65a6ec0d
...@@ -407,11 +407,16 @@ do_mathemu(struct pt_regs *regs) ...@@ -407,11 +407,16 @@ do_mathemu(struct pt_regs *regs)
case XE: case XE:
idx = (insn >> 16) & 0x1f; idx = (insn >> 16) & 0x1f;
if (!idx)
goto illegal;
op0 = (void *)&current->thread.fpr[(insn >> 21) & 0x1f]; op0 = (void *)&current->thread.fpr[(insn >> 21) & 0x1f];
op1 = (void *)(regs->gpr[idx] + regs->gpr[(insn >> 11) & 0x1f]); if (!idx) {
if (((insn >> 1) & 0x3ff) == STFIWX)
op1 = (void *)(regs->gpr[(insn >> 11) & 0x1f]);
else
goto illegal;
} else {
op1 = (void *)(regs->gpr[idx] + regs->gpr[(insn >> 11) & 0x1f]);
}
break; break;
case XEU: case XEU:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册