Skip to content

Commit

Permalink
x86/fpu: Don't reset thread.fpu_counter
Browse files Browse the repository at this point in the history
The "else" branch clears ->fpu_counter as a remnant of the lazy FPU
usage counting:

  e07e23e ("[PATCH] non lazy "sleazy" fpu implementation")

However, switch_fpu_prepare() does this now so that else branch is
superfluous.

If we do use_eager_fpu(), then this has no effect. Otherwise, if we
actually wanted to prevent fpu preload after the context switch we would
need to reset it unconditionally, even if __thread_has_fpu().

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Rik van Riel <riel@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/1423252925-14451-2-git-send-email-riel@redhat.com
Signed-off-by: Borislav Petkov <bp@suse.de>
  • Loading branch information
Oleg Nesterov authored and Borislav Petkov committed Feb 19, 2015
1 parent bfa76d4 commit a9241ea
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions arch/x86/kernel/i387.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ void unlazy_fpu(struct task_struct *tsk)
if (__thread_has_fpu(tsk)) {
__save_init_fpu(tsk);
__thread_fpu_end(tsk);
} else
tsk->thread.fpu_counter = 0;
}
preempt_enable();
}
EXPORT_SYMBOL(unlazy_fpu);
Expand Down

0 comments on commit a9241ea

Please sign in to comment.