aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/signal.c
diff options
context:
space:
mode:
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>2007-04-13 13:37:26 -0400
committerRalf Baechle <ralf@linux-mips.org>2007-04-20 09:58:37 -0400
commit5323180db75d562a287cb2020b07c9422df13df6 (patch)
tree71039fd0a03f89ebb3172d75a9e594d4f9f56fd6 /arch/mips/kernel/signal.c
parent9a9943575ade643368849e2c963094ac637867e0 (diff)
[MIPS] Disallow CpU exception in kernel again.
The commit 4d40bff7110e9e1a97ff8c01bdd6350e9867cc10 ("Allow CpU exception in kernel partially") was broken. The commit was to fix theoretical problem but broke usual case. Revert it for now. Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel/signal.c')
-rw-r--r--arch/mips/kernel/signal.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c
index 8c3c5a5789b0..fa581192de21 100644
--- a/arch/mips/kernel/signal.c
+++ b/arch/mips/kernel/signal.c
@@ -113,10 +113,10 @@ int setup_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
113 * Save FPU state to signal context. Signal handler 113 * Save FPU state to signal context. Signal handler
114 * will "inherit" current FPU state. 114 * will "inherit" current FPU state.
115 */ 115 */
116 preempt_disable();
116 own_fpu(1); 117 own_fpu(1);
117 enable_fp_in_kernel();
118 err |= save_fp_context(sc); 118 err |= save_fp_context(sc);
119 disable_fp_in_kernel(); 119 preempt_enable();
120 } 120 }
121 return err; 121 return err;
122} 122}
@@ -148,7 +148,10 @@ check_and_restore_fp_context(struct sigcontext __user *sc)
148 err = sig = fpcsr_pending(&sc->sc_fpc_csr); 148 err = sig = fpcsr_pending(&sc->sc_fpc_csr);
149 if (err > 0) 149 if (err > 0)
150 err = 0; 150 err = 0;
151 preempt_disable();
152 own_fpu(0);
151 err |= restore_fp_context(sc); 153 err |= restore_fp_context(sc);
154 preempt_enable();
152 return err ?: sig; 155 return err ?: sig;
153} 156}
154 157
@@ -187,11 +190,8 @@ int restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
187 190
188 if (used_math) { 191 if (used_math) {
189 /* restore fpu context if we have used it before */ 192 /* restore fpu context if we have used it before */
190 own_fpu(0);
191 enable_fp_in_kernel();
192 if (!err) 193 if (!err)
193 err = check_and_restore_fp_context(sc); 194 err = check_and_restore_fp_context(sc);
194 disable_fp_in_kernel();
195 } else { 195 } else {
196 /* signal handler may have used FPU. Give it up. */ 196 /* signal handler may have used FPU. Give it up. */
197 lose_fpu(0); 197 lose_fpu(0);