aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86
diff options
context:
space:
mode:
authorSuresh Siddha <suresh.b.siddha@intel.com>2008-05-07 15:09:52 -0400
committerThomas Gleixner <tglx@linutronix.de>2008-05-10 13:31:45 -0400
commitfd3c3ed5d1e3ceb37635cbe6d220ab94aae0781d (patch)
tree67cc2a950e670e5362173efd88ea6ded708b7e6c /include/asm-x86
parent0646153921892cc7a81320a6920beaca06b3e9f0 (diff)
x86: fix fpu restore from sig return
If the task never used fpu, initialize the fpu before restoring the FP state from the signal handler context. This will allocate the fpu state, if the task never needed it before. Reported-and-bisected-by: Eric Sesterhenn <snakebyte@gmx.de> Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> Tested-by: Eric Sesterhenn <snakebyte@gmx.de> Cc: Frederik Deweerdt <deweerdt@free.fr> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-x86')
-rw-r--r--include/asm-x86/i387.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/asm-x86/i387.h b/include/asm-x86/i387.h
index da2adb45f6e3..6b722d315936 100644
--- a/include/asm-x86/i387.h
+++ b/include/asm-x86/i387.h
@@ -175,7 +175,15 @@ static inline int save_i387(struct _fpstate __user *buf)
175 */ 175 */
176static inline int restore_i387(struct _fpstate __user *buf) 176static inline int restore_i387(struct _fpstate __user *buf)
177{ 177{
178 set_used_math(); 178 struct task_struct *tsk = current;
179 int err;
180
181 if (!used_math()) {
182 err = init_fpu(tsk);
183 if (err)
184 return err;
185 }
186
179 if (!(task_thread_info(current)->status & TS_USEDFPU)) { 187 if (!(task_thread_info(current)->status & TS_USEDFPU)) {
180 clts(); 188 clts();
181 task_thread_info(current)->status |= TS_USEDFPU; 189 task_thread_info(current)->status |= TS_USEDFPU;