summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/i387.c
diff options
context:
space:
mode:
authorOleg Nesterov2015-02-06 21:01:58 +0100
committerBorislav Petkov2015-02-19 11:12:40 +0100
commita9241ea5fd709fc935dade130f4e3b2612bbe9e3 (patch)
tree73b7221bea33cb1caed9c79fb30018aec5274ed4 /arch/x86/kernel/i387.c
parentLinux 3.19 (diff)
downloadkernel-qcow2-linux-a9241ea5fd709fc935dade130f4e3b2612bbe9e3.tar.gz
kernel-qcow2-linux-a9241ea5fd709fc935dade130f4e3b2612bbe9e3.tar.xz
kernel-qcow2-linux-a9241ea5fd709fc935dade130f4e3b2612bbe9e3.zip
x86/fpu: Don't reset thread.fpu_counter
The "else" branch clears ->fpu_counter as a remnant of the lazy FPU usage counting: e07e23e1fd30 ("[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>
Diffstat (limited to 'arch/x86/kernel/i387.c')
-rw-r--r--arch/x86/kernel/i387.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c
index a9a4229f6161..4d0db9ed58e0 100644
--- a/arch/x86/kernel/i387.c
+++ b/arch/x86/kernel/i387.c
@@ -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);