Commit 8e24cc70 authored by Linus Torvalds's avatar Linus Torvalds

Fix x86 "clear_cpu()" macro.

We need to clear all exceptions before synchronizing
with the FPU, since we aren't ready to handle a FP
exception here and we're getting rid of all FP state.

Special thanks to Alexander Nyberg for reports and
testing. Alternate patches by Sergey Vlasov and Andi
Kleen, who both worked on this.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>  
parent 981a1ad3
...@@ -51,7 +51,7 @@ static inline void __save_init_fpu( struct task_struct *tsk ) ...@@ -51,7 +51,7 @@ static inline void __save_init_fpu( struct task_struct *tsk )
#define __clear_fpu( tsk ) \ #define __clear_fpu( tsk ) \
do { \ do { \
if ((tsk)->thread_info->status & TS_USEDFPU) { \ if ((tsk)->thread_info->status & TS_USEDFPU) { \
asm volatile("fwait"); \ asm volatile("fnclex ; fwait"); \
(tsk)->thread_info->status &= ~TS_USEDFPU; \ (tsk)->thread_info->status &= ~TS_USEDFPU; \
stts(); \ stts(); \
} \ } \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment