aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/r2300_fpu.S
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@imgtec.com>2016-10-28 08:21:03 +0100
committerRalf Baechle <ralf@linux-mips.org>2016-11-04 01:28:41 +0100
commit5a1aca4469fdccd5b74ba0b4e490173b2b447895 (patch)
treebdfad3f7a9ce39cc48edd2a1cff8c89a0549c60a /arch/mips/kernel/r2300_fpu.S
parentMIPS: ptrace: Also initialize the FP context on individual FCSR writes (diff)
downloadlinux-dev-5a1aca4469fdccd5b74ba0b4e490173b2b447895.tar.xz
linux-dev-5a1aca4469fdccd5b74ba0b4e490173b2b447895.zip
MIPS: Fix FCSR Cause bit handling for correct SIGFPE issue
Sanitize FCSR Cause bit handling, following a trail of past attempts: * commit 4249548454f7 ("MIPS: ptrace: Fix FP context restoration FCSR regression"), * commit 443c44032a54 ("MIPS: Always clear FCSR cause bits after emulation"), * commit 64bedffe4968 ("MIPS: Clear [MSA]FPE CSR.Cause after notify_die()"), * commit b1442d39fac2 ("MIPS: Prevent user from setting FCSR cause bits"), * commit b54d2901517d ("Properly handle branch delay slots in connection with signals."). Specifically do not mask these bits out in ptrace(2) processing and send a SIGFPE signal instead whenever a matching pair of an FCSR Cause and Enable bit is seen as execution of an affected context is about to resume. Only then clear Cause bits, and even then do not clear any bits that are set but masked with the respective Enable bits. Adjust Cause bit clearing throughout code likewise, except within the FPU emulator proper where they are set according to IEEE 754 exceptions raised as the operation emulated executed. Do so so that any IEEE 754 exceptions subject to their default handling are recorded like with operations executed by FPU hardware. Signed-off-by: Maciej W. Rozycki <macro@imgtec.com> Cc: Paul Burton <paul.burton@imgtec.com> Cc: James Hogan <james.hogan@imgtec.com> Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/14460/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel/r2300_fpu.S')
0 files changed, 0 insertions, 0 deletions