diff options
author | Paul Burton <paul.burton@imgtec.com> | 2016-04-21 14:04:55 +0100 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2016-06-06 19:12:20 -0400 |
commit | fc39f274bfb6bcff688b099ccbcc081460bb0325 (patch) | |
tree | 2f040ded44102e50a7e06a440faf8d212be53953 /arch/mips/kernel/ptrace.c | |
parent | 4a16f41bf4a45e70a73e0fdc9bfcc81776387783 (diff) |
MIPS: math-emu: Fix jalr emulation when rd == $0
[ Upstream commit ab4a92e66741b35ca12f8497896bafbe579c28a1 ]
When emulating a jalr instruction with rd == $0, the code in
isBranchInstr was incorrectly writing to GPR $0 which should actually
always remain zeroed. This would lead to any further instructions
emulated which use $0 operating on a bogus value until the task is next
context switched, at which point the value of $0 in the task context
would be restored to the correct zero by a store in SAVE_SOME. Fix this
by not writing to rd if it is $0.
Fixes: 102cedc32a6e ("MIPS: microMIPS: Floating point support.")
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: Maciej W. Rozycki <macro@imgtec.com>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Cc: stable <stable@vger.kernel.org> # v3.10
Patchwork: https://patchwork.linux-mips.org/patch/13160/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Diffstat (limited to 'arch/mips/kernel/ptrace.c')
0 files changed, 0 insertions, 0 deletions