diff options
Diffstat (limited to 'include/asm-i386/i387.h')
-rw-r--r-- | include/asm-i386/i387.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/include/asm-i386/i387.h b/include/asm-i386/i387.h index e678609bb57e..6747006743f9 100644 --- a/include/asm-i386/i387.h +++ b/include/asm-i386/i387.h | |||
@@ -33,7 +33,7 @@ extern void init_fpu(struct task_struct *); | |||
33 | "nop ; frstor %1", \ | 33 | "nop ; frstor %1", \ |
34 | "fxrstor %1", \ | 34 | "fxrstor %1", \ |
35 | X86_FEATURE_FXSR, \ | 35 | X86_FEATURE_FXSR, \ |
36 | "m" ((tsk)->thread.i387.fsave)) | 36 | "m" ((tsk)->thread.i387.fxsave)) |
37 | 37 | ||
38 | extern void kernel_fpu_begin(void); | 38 | extern void kernel_fpu_begin(void); |
39 | #define kernel_fpu_end() do { stts(); preempt_enable(); } while(0) | 39 | #define kernel_fpu_end() do { stts(); preempt_enable(); } while(0) |
@@ -43,13 +43,12 @@ extern void kernel_fpu_begin(void); | |||
43 | */ | 43 | */ |
44 | static inline void __save_init_fpu( struct task_struct *tsk ) | 44 | static inline void __save_init_fpu( struct task_struct *tsk ) |
45 | { | 45 | { |
46 | if ( cpu_has_fxsr ) { | 46 | alternative_input( |
47 | asm volatile( "fxsave %0 ; fnclex" | 47 | "fnsave %1 ; fwait ;" GENERIC_NOP2, |
48 | : "=m" (tsk->thread.i387.fxsave) ); | 48 | "fxsave %1 ; fnclex", |
49 | } else { | 49 | X86_FEATURE_FXSR, |
50 | asm volatile( "fnsave %0 ; fwait" | 50 | "m" (tsk->thread.i387.fxsave) |
51 | : "=m" (tsk->thread.i387.fsave) ); | 51 | :"memory"); |
52 | } | ||
53 | tsk->thread_info->status &= ~TS_USEDFPU; | 52 | tsk->thread_info->status &= ~TS_USEDFPU; |
54 | } | 53 | } |
55 | 54 | ||