lkml.org 
[lkml]   [2020]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] MIPS: Fix IRQ tracing when call handle_fpe()
Date
 Register "a1" is unsaved in this function,
when CONFIG_TRACE_IRQFLAGS is enabled,
the TRACE_IRQS_OFF macro will call trace_hardirqs_off(),
and this may change register "a1".
The variment of register "a1" may send SIGFPE signal
to task when call do_fpe(),and this may kill the task.

Signed-off-by: YuanJunQing <yuanjunqing66@163.com>
---
arch/mips/kernel/genex.S | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S
index 8236fb291e3f..956a76429773 100644
--- a/arch/mips/kernel/genex.S
+++ b/arch/mips/kernel/genex.S
@@ -480,16 +480,18 @@ NESTED(nmi_handler, PT_SIZE, sp)
/* gas fails to assemble cfc1 for some archs (octeon).*/ \
.set mips1
SET_HARDFLOAT
- cfc1 a1, fcr31
+ cfc1 s0, fcr31
.set pop
CLI
TRACE_IRQS_OFF
+ move a1,s0
.endm

.macro __build_clear_msa_fpe
- _cfcmsa a1, MSA_CSR
+ _cfcmsa s0, MSA_CSR
CLI
TRACE_IRQS_OFF
+ move a1,s0
.endm

.macro __build_clear_ade
--
2.17.1
\
 
 \ /
  Last update: 2020-05-25 05:48    [W:0.061 / U:0.636 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site