aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSiddha, Suresh B <suresh.b.siddha@intel.com>2007-11-11 14:27:59 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-11-12 14:09:33 -0500
commit92d140e21f1ce8cf99320afbbcad73879128e6dc (patch)
tree54a67ee106da78b2a5f265e8e12fc84b92e763d6 /include
parentefe44183f6bab5b8acb6a6182d95274978c8abb1 (diff)
x86: fix taking DNA during 64bit sigreturn
restore sigcontext is taking a DNA exception while restoring FP context from the user stack, during the sigreturn. Appended patch fixes it by doing clts() if the app doesn't touch FP during the signal handler execution. This will stop generating a DNA, during the fxrstor in the sigreturn. This improves 64-bit lat_sig numbers by ~30% on my core2 platform. Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/asm-x86/i387_64.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/asm-x86/i387_64.h b/include/asm-x86/i387_64.h
index 0217b74cc9fc..3a4ffba3d6bc 100644
--- a/include/asm-x86/i387_64.h
+++ b/include/asm-x86/i387_64.h
@@ -203,6 +203,11 @@ static inline void save_init_fpu(struct task_struct *tsk)
203 */ 203 */
204static inline int restore_i387(struct _fpstate __user *buf) 204static inline int restore_i387(struct _fpstate __user *buf)
205{ 205{
206 set_used_math();
207 if (!(task_thread_info(current)->status & TS_USEDFPU)) {
208 clts();
209 task_thread_info(current)->status |= TS_USEDFPU;
210 }
206 return restore_fpu_checking((__force struct i387_fxsave_struct *)buf); 211 return restore_fpu_checking((__force struct i387_fxsave_struct *)buf);
207} 212}
208 213