diff options
author | Maciej W. Rozycki <macro@linux-mips.org> | 2015-04-03 18:27:15 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2015-04-07 19:10:19 -0400 |
commit | 304acb717e5b67cf56f05bc5b21123758e1f7ea0 (patch) | |
tree | 031d9969f99864c02701d9df056f92c894a56116 /arch/mips/kernel/mips-r2-to-r6-emul.c | |
parent | 443c44032a54f9acf027a8e688380fddc809bc19 (diff) |
MIPS: Set `si_code' for SIGFPE signals sent from emulation too
Rework `process_fpemu_return' and move IEEE 754 exception interpretation
there, from `do_fpe'. Record the cause bits set in FCSR before they are
cleared and pass them through to `process_fpemu_return' so as to set
`si_code' correctly too for SIGFPE signals sent from emulation rather
than those issued by hardware with the FPE processor exception only.
For simplicity `mipsr2_decoder' assumes `*fcr31' has been preinitialised
and only sets it to anything if an FPU instruction has been emulated,
which in turn is the only case SIGFPE can be issued for here.
Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9705/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel/mips-r2-to-r6-emul.c')
-rw-r--r-- | arch/mips/kernel/mips-r2-to-r6-emul.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/mips/kernel/mips-r2-to-r6-emul.c b/arch/mips/kernel/mips-r2-to-r6-emul.c index 6633fa97d431..f2977f00911b 100644 --- a/arch/mips/kernel/mips-r2-to-r6-emul.c +++ b/arch/mips/kernel/mips-r2-to-r6-emul.c | |||
@@ -898,8 +898,9 @@ static inline int mipsr2_find_op_func(struct pt_regs *regs, u32 inst, | |||
898 | * mipsr2_decoder: Decode and emulate a MIPS R2 instruction | 898 | * mipsr2_decoder: Decode and emulate a MIPS R2 instruction |
899 | * @regs: Process register set | 899 | * @regs: Process register set |
900 | * @inst: Instruction to decode and emulate | 900 | * @inst: Instruction to decode and emulate |
901 | * @fcr31: Floating Point Control and Status Register returned | ||
901 | */ | 902 | */ |
902 | int mipsr2_decoder(struct pt_regs *regs, u32 inst) | 903 | int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31) |
903 | { | 904 | { |
904 | int err = 0; | 905 | int err = 0; |
905 | unsigned long vaddr; | 906 | unsigned long vaddr; |
@@ -1168,6 +1169,7 @@ fpu_emul: | |||
1168 | 1169 | ||
1169 | err = fpu_emulator_cop1Handler(regs, ¤t->thread.fpu, 0, | 1170 | err = fpu_emulator_cop1Handler(regs, ¤t->thread.fpu, 0, |
1170 | &fault_addr); | 1171 | &fault_addr); |
1172 | *fcr31 = current->thread.fpu.fcr31; | ||
1171 | 1173 | ||
1172 | /* | 1174 | /* |
1173 | * We can't allow the emulated instruction to leave any of | 1175 | * We can't allow the emulated instruction to leave any of |