aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/fpu-internal.h
diff options
context:
space:
mode:
authorSuresh Siddha <suresh.b.siddha@intel.com>2012-08-24 17:12:57 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2012-09-18 18:52:05 -0400
commite962591749dfd4df9fea2c530ed7a3cfed50e5aa (patch)
tree9465f4181ef0431c03c1dcd92674b028f37a9d3e /arch/x86/include/asm/fpu-internal.h
parent72a671ced66db6d1c2bfff1c930a101ac8d08204 (diff)
x86, fpu: drop_fpu() before restoring new state from sigframe
No need to save the state with unlazy_fpu(), that is about to get overwritten by the state from the signal frame. Instead use drop_fpu() and continue to restore the new state. Also fold the stop_fpu_preload() into drop_fpu(). Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> Link: http://lkml.kernel.org/r/1345842782-24175-2-git-send-email-suresh.b.siddha@intel.com Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/include/asm/fpu-internal.h')
-rw-r--r--arch/x86/include/asm/fpu-internal.h7
1 files changed, 1 insertions, 6 deletions
diff --git a/arch/x86/include/asm/fpu-internal.h b/arch/x86/include/asm/fpu-internal.h
index 4fbb4195bc63..78169d133d4c 100644
--- a/arch/x86/include/asm/fpu-internal.h
+++ b/arch/x86/include/asm/fpu-internal.h
@@ -448,17 +448,12 @@ static inline void save_init_fpu(struct task_struct *tsk)
448 preempt_enable(); 448 preempt_enable();
449} 449}
450 450
451static inline void stop_fpu_preload(struct task_struct *tsk)
452{
453 tsk->fpu_counter = 0;
454}
455
456static inline void drop_fpu(struct task_struct *tsk) 451static inline void drop_fpu(struct task_struct *tsk)
457{ 452{
458 /* 453 /*
459 * Forget coprocessor state.. 454 * Forget coprocessor state..
460 */ 455 */
461 stop_fpu_preload(tsk); 456 tsk->fpu_counter = 0;
462 preempt_disable(); 457 preempt_disable();
463 __drop_fpu(tsk); 458 __drop_fpu(tsk);
464 preempt_enable(); 459 preempt_enable();