diff options
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/include/asm/i387.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h index f704be239883..1e12c2d087e4 100644 --- a/arch/x86/include/asm/i387.h +++ b/arch/x86/include/asm/i387.h | |||
@@ -259,7 +259,6 @@ static inline void fpu_save_init(struct fpu *fpu) | |||
259 | static inline void __save_init_fpu(struct task_struct *tsk) | 259 | static inline void __save_init_fpu(struct task_struct *tsk) |
260 | { | 260 | { |
261 | fpu_save_init(&tsk->thread.fpu); | 261 | fpu_save_init(&tsk->thread.fpu); |
262 | task_thread_info(tsk)->status &= ~TS_USEDFPU; | ||
263 | } | 262 | } |
264 | 263 | ||
265 | static inline int fpu_fxrstor_checking(struct fpu *fpu) | 264 | static inline int fpu_fxrstor_checking(struct fpu *fpu) |
@@ -290,6 +289,7 @@ static inline void __unlazy_fpu(struct task_struct *tsk) | |||
290 | { | 289 | { |
291 | if (task_thread_info(tsk)->status & TS_USEDFPU) { | 290 | if (task_thread_info(tsk)->status & TS_USEDFPU) { |
292 | __save_init_fpu(tsk); | 291 | __save_init_fpu(tsk); |
292 | task_thread_info(tsk)->status &= ~TS_USEDFPU; | ||
293 | stts(); | 293 | stts(); |
294 | } else | 294 | } else |
295 | tsk->fpu_counter = 0; | 295 | tsk->fpu_counter = 0; |
@@ -356,9 +356,11 @@ static inline void kernel_fpu_begin(void) | |||
356 | 356 | ||
357 | WARN_ON_ONCE(!irq_fpu_usable()); | 357 | WARN_ON_ONCE(!irq_fpu_usable()); |
358 | preempt_disable(); | 358 | preempt_disable(); |
359 | if (me->status & TS_USEDFPU) | 359 | if (me->status & TS_USEDFPU) { |
360 | __save_init_fpu(me->task); | 360 | __save_init_fpu(me->task); |
361 | else | 361 | me->status &= ~TS_USEDFPU; |
362 | /* We do 'stts()' in kernel_fpu_end() */ | ||
363 | } else | ||
362 | clts(); | 364 | clts(); |
363 | } | 365 | } |
364 | 366 | ||
@@ -449,6 +451,7 @@ static inline void save_init_fpu(struct task_struct *tsk) | |||
449 | WARN_ON_ONCE(!(task_thread_info(tsk)->status & TS_USEDFPU)); | 451 | WARN_ON_ONCE(!(task_thread_info(tsk)->status & TS_USEDFPU)); |
450 | preempt_disable(); | 452 | preempt_disable(); |
451 | __save_init_fpu(tsk); | 453 | __save_init_fpu(tsk); |
454 | task_thread_info(tsk)->status &= ~TS_USEDFPU; | ||
452 | stts(); | 455 | stts(); |
453 | preempt_enable(); | 456 | preempt_enable(); |
454 | } | 457 | } |