MIPS: Send SIGILL for linked branches in `__compute_return_epc_for_insn'
authorMaciej W. Rozycki <macro@imgtec.com>
Thu, 15 Jun 2017 23:12:53 +0000 (00:12 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jul 2017 22:08:05 +0000 (15:08 -0700)
commitd4bd6a1df2c816b7027f9cf1a900ae52f528f300
tree2efbd4b961b915e41ed28b219bf6318f680d8db6
parent99ce76144dee8dfbedeccfe7fed85f61d31c6379
MIPS: Send SIGILL for linked branches in `__compute_return_epc_for_insn'

commit fef40be6da856afead4177aaa9d869a66fb3381f upstream.

Fix commit 319824eabc3f ("MIPS: kernel: branch: Do not emulate the
branch likelies on MIPS R6") and also send SIGILL rather than returning
-SIGILL for BLTZAL, BLTZALL, BGEZAL and BGEZALL instruction encodings no
longer supported in R6, except where emulated.  Returning -SIGILL is
never correct as the API defines this function's result upon error to be
-EFAULT and a signal actually issued.

Fixes: 319824eabc3f ("MIPS: kernel: branch: Do not emulate the branch likelies on MIPS R6")
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/16398/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/mips/kernel/branch.c