From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752882AbbCWMVs (ORCPT ); Mon, 23 Mar 2015 08:21:48 -0400 Received: from terminus.zytor.com ([198.137.202.10]:41213 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752847AbbCWMVl (ORCPT ); Mon, 23 Mar 2015 08:21:41 -0400 Date: Mon, 23 Mar 2015 05:21:19 -0700 From: tip-bot for Oleg Nesterov Message-ID: Cc: tglx@linutronix.de, sbsiddha@gmail.com, priikone@iki.fi, bp@suse.de, linux-kernel@vger.kernel.org, luto@amacapital.net, quentin.casasnovas@oracle.com, riel@redhat.com, hpa@zytor.com, oleg@redhat.com, torvalds@linux-foundation.org, dave.hansen@intel.com, mingo@kernel.org, fenghua.yu@intel.com Reply-To: bp@suse.de, linux-kernel@vger.kernel.org, luto@amacapital.net, quentin.casasnovas@oracle.com, tglx@linutronix.de, priikone@iki.fi, sbsiddha@gmail.com, riel@redhat.com, oleg@redhat.com, hpa@zytor.com, mingo@kernel.org, fenghua.yu@intel.com, torvalds@linux-foundation.org, dave.hansen@intel.com In-Reply-To: <20150311173449.GE5032@redhat.com> References: <20150311173449.GE5032@redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/fpu] x86/fpu: Use restore_init_xstate() instead of math_state_restore() on kthread exec Git-Commit-ID: 9cb6ce823bbd1adbe15e30bd1435c84c2e271767 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: 9cb6ce823bbd1adbe15e30bd1435c84c2e271767 Gitweb: http://git.kernel.org/tip/9cb6ce823bbd1adbe15e30bd1435c84c2e271767 Author: Oleg Nesterov AuthorDate: Wed, 11 Mar 2015 18:34:49 +0100 Committer: Ingo Molnar CommitDate: Mon, 23 Mar 2015 10:13:58 +0100 x86/fpu: Use restore_init_xstate() instead of math_state_restore() on kthread exec Change flush_thread() to do user_fpu_begin() and restore_init_xstate() instead of math_state_restore(). Note: "TODO: cleanup this horror" is still valid. We do not need init_fpu() at all, we only need fpu_alloc() and memset(0). But this needs other changes, in particular user_fpu_begin() should set used_math(). Signed-off-by: Oleg Nesterov Signed-off-by: Borislav Petkov Cc: Andy Lutomirski Cc: Dave Hansen Cc: Fenghua Yu Cc: Linus Torvalds Cc: Pekka Riikonen Cc: Quentin Casasnovas Cc: Rik van Riel Cc: Suresh Siddha Link: http://lkml.kernel.org/r/20150311173449.GE5032@redhat.com Signed-off-by: Ingo Molnar --- arch/x86/kernel/process.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index dcaf4b0..6b05829 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c @@ -143,7 +143,8 @@ void flush_thread(void) /* kthread execs. TODO: cleanup this horror. */ if (WARN_ON(init_fpu(current))) force_sig(SIGKILL, current); - math_state_restore(); + user_fpu_begin(); + restore_init_xstate(); } }