OSDN Git Service

MIPS: Fix unaligned PC interpretation in `compute_return_epc'
authorMaciej W. Rozycki <macro@imgtec.com>
Thu, 15 Jun 2017 23:07:34 +0000 (00:07 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jul 2017 22:06:08 +0000 (15:06 -0700)
commit9dbca9e8a91ac382dc0e643f7a666166e04dc229
treed68664e8c6a8c46867b3b9d2bb2c91e5d8d0382e
parentaebb79634ff16538b7685fdefaf6ccfaf0b4fcdc
MIPS: Fix unaligned PC interpretation in `compute_return_epc'

commit 11a3799dbeb620bf0400b1fda5cc2c6bea55f20a upstream.

Fix a regression introduced with commit fb6883e5809c ("MIPS: microMIPS:
Support handling of delay slots.") and defer to `__compute_return_epc'
if the ISA bit is set in EPC with non-MIPS16, non-microMIPS hardware,
which will then arrange for a SIGBUS due to an unaligned instruction
reference.  Returning EPC here is never correct as the API defines this
function's result to be either a negative error code on failure or one
of 0 and BRANCH_LIKELY_TAKEN on success.

Fixes: fb6883e5809c ("MIPS: microMIPS: Support handling of delay slots.")
Signed-off-by: Maciej W. Rozycki <macro@imgtec.com>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/16395/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/mips/include/asm/branch.h