From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753257AbbBSLcl (ORCPT ); Thu, 19 Feb 2015 06:32:41 -0500 Received: from terminus.zytor.com ([198.137.202.10]:53013 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753181AbbBSLck (ORCPT ); Thu, 19 Feb 2015 06:32:40 -0500 Date: Thu, 19 Feb 2015 03:32:24 -0800 From: tip-bot for Oleg Nesterov Message-ID: Cc: riel@redhat.com, torvalds@linux-foundation.org, mingo@kernel.org, hpa@zytor.com, oleg@redhat.com, tglx@linutronix.de, bp@suse.de, linux-kernel@vger.kernel.org Reply-To: torvalds@linux-foundation.org, mingo@kernel.org, riel@redhat.com, hpa@zytor.com, oleg@redhat.com, tglx@linutronix.de, bp@suse.de, linux-kernel@vger.kernel.org In-Reply-To: <1423252925-14451-2-git-send-email-riel@redhat.com> References: <1423252925-14451-2-git-send-email-riel@redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/fpu] x86/fpu: Don't reset thread.fpu_counter Git-Commit-ID: a9241ea5fd709fc935dade130f4e3b2612bbe9e3 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: a9241ea5fd709fc935dade130f4e3b2612bbe9e3 Gitweb: http://git.kernel.org/tip/a9241ea5fd709fc935dade130f4e3b2612bbe9e3 Author: Oleg Nesterov AuthorDate: Fri, 6 Feb 2015 15:01:58 -0500 Committer: Borislav Petkov CommitDate: Thu, 19 Feb 2015 11:12:40 +0100 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 Signed-off-by: Rik van Riel Cc: Linus Torvalds Link: http://lkml.kernel.org/r/1423252925-14451-2-git-send-email-riel@redhat.com Signed-off-by: Borislav Petkov --- arch/x86/kernel/i387.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c index a9a4229..4d0db9e 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);