mirror of https://gitee.com/openkylin/linux.git
[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: Kumar Gala <galak@kernel.crashing.org>
This commit is contained in:
parent
65a6ec0d72
commit
ba02946a90
|
@ -407,11 +407,16 @@ do_mathemu(struct pt_regs *regs)
|
|||
|
||||
case XE:
|
||||
idx = (insn >> 16) & 0x1f;
|
||||
if (!idx)
|
||||
goto illegal;
|
||||
|
||||
op0 = (void *)¤t->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;
|
||||
|
||||
case XEU:
|
||||
|
|
Loading…
Reference in New Issue