From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752842AbbCWMV2 (ORCPT ); Mon, 23 Mar 2015 08:21:28 -0400 Received: from terminus.zytor.com ([198.137.202.10]:41196 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752423AbbCWMVX (ORCPT ); Mon, 23 Mar 2015 08:21:23 -0400 Date: Mon, 23 Mar 2015 05:20:39 -0700 From: tip-bot for Oleg Nesterov Message-ID: Cc: tglx@linutronix.de, luto@amacapital.net, linux-kernel@vger.kernel.org, priikone@iki.fi, mingo@kernel.org, riel@redhat.com, bp@suse.de, oleg@redhat.com, hpa@zytor.com, torvalds@linux-foundation.org, quentin.casasnovas@oracle.com, fenghua.yu@intel.com, dave.hansen@intel.com, sbsiddha@gmail.com Reply-To: luto@amacapital.net, linux-kernel@vger.kernel.org, priikone@iki.fi, riel@redhat.com, mingo@kernel.org, bp@suse.de, oleg@redhat.com, tglx@linutronix.de, fenghua.yu@intel.com, dave.hansen@intel.com, sbsiddha@gmail.com, hpa@zytor.com, torvalds@linux-foundation.org, quentin.casasnovas@oracle.com In-Reply-To: <20150311173409.GC5032@redhat.com> References: <20150311173409.GC5032@redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/fpu] x86/fpu: Document user_fpu_begin() Git-Commit-ID: fb14b4eadf73500d3b2104f031472a268562c047 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: fb14b4eadf73500d3b2104f031472a268562c047 Gitweb: http://git.kernel.org/tip/fb14b4eadf73500d3b2104f031472a268562c047 Author: Oleg Nesterov AuthorDate: Wed, 11 Mar 2015 18:34:09 +0100 Committer: Ingo Molnar CommitDate: Mon, 23 Mar 2015 10:13:58 +0100 x86/fpu: Document user_fpu_begin() Currently, user_fpu_begin() has a single caller and it is not clear why do we actually need it and why we should not worry about preemption right after preempt_enable(). 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/20150311173409.GC5032@redhat.com Signed-off-by: Ingo Molnar --- arch/x86/include/asm/fpu-internal.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/fpu-internal.h b/arch/x86/include/asm/fpu-internal.h index 810f20f..c58c930 100644 --- a/arch/x86/include/asm/fpu-internal.h +++ b/arch/x86/include/asm/fpu-internal.h @@ -508,10 +508,12 @@ static inline int restore_xstate_sig(void __user *buf, int ia32_frame) } /* - * Need to be preemption-safe. + * Needs to be preemption-safe. * * NOTE! user_fpu_begin() must be used only immediately before restoring - * it. This function does not do any save/restore on their own. + * the save state. It does not do any saving/restoring on its own. In + * lazy FPU mode, it is just an optimization to avoid a #NM exception, + * the task can lose the FPU right after preempt_enable(). */ static inline void user_fpu_begin(void) {