Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

i387: move TS_USEDFPU clearing out of __save_init_fpu and into callers

Touching TS_USEDFPU without touching CR0.TS is confusing, so don't do
it. By moving it into the callers, we always do the TS_USEDFPU next to
the CR0.TS accesses in the source code, and it's much easier to see how
the two go hand in hand.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

+6 -3
+6 -3
arch/x86/include/asm/i387.h
··· 259 259 static inline void __save_init_fpu(struct task_struct *tsk) 260 260 { 261 261 fpu_save_init(&tsk->thread.fpu); 262 - task_thread_info(tsk)->status &= ~TS_USEDFPU; 263 262 } 264 263 265 264 static inline int fpu_fxrstor_checking(struct fpu *fpu) ··· 289 290 { 290 291 if (task_thread_info(tsk)->status & TS_USEDFPU) { 291 292 __save_init_fpu(tsk); 293 + task_thread_info(tsk)->status &= ~TS_USEDFPU; 292 294 stts(); 293 295 } else 294 296 tsk->fpu_counter = 0; ··· 356 356 357 357 WARN_ON_ONCE(!irq_fpu_usable()); 358 358 preempt_disable(); 359 - if (me->status & TS_USEDFPU) 359 + if (me->status & TS_USEDFPU) { 360 360 __save_init_fpu(me->task); 361 - else 361 + me->status &= ~TS_USEDFPU; 362 + /* We do 'stts()' in kernel_fpu_end() */ 363 + } else 362 364 clts(); 363 365 } 364 366 ··· 451 449 WARN_ON_ONCE(!(task_thread_info(tsk)->status & TS_USEDFPU)); 452 450 preempt_disable(); 453 451 __save_init_fpu(tsk); 452 + task_thread_info(tsk)->status &= ~TS_USEDFPU; 454 453 stts(); 455 454 preempt_enable(); 456 455 }