From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752862AbbCMOhB (ORCPT ); Fri, 13 Mar 2015 10:37:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34726 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751450AbbCMOhA (ORCPT ); Fri, 13 Mar 2015 10:37:00 -0400 Date: Fri, 13 Mar 2015 15:34:49 +0100 From: Oleg Nesterov To: Borislav Petkov Cc: Dave Hansen , Ingo Molnar , Andy Lutomirski , Linus Torvalds , Pekka Riikonen , Rik van Riel , Suresh Siddha , LKML , "Yu, Fenghua" , Quentin Casasnovas Subject: Re: [PATCH 1/4] x86/fpu: document user_fpu_begin() Message-ID: <20150313143449.GA21603@redhat.com> References: <54F74F59.5070107@intel.com> <20150311173346.GB5032@redhat.com> <20150311173409.GC5032@redhat.com> <20150313094708.GA31998@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150313094708.GA31998@pd.tnic> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/13, Borislav Petkov wrote: > > On Wed, Mar 11, 2015 at 06:34:09PM +0100, Oleg Nesterov wrote: > > @@ -464,7 +464,9 @@ static inline int restore_xstate_sig(void __user *buf, int ia32_frame) > > * Need 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. > > + * it. This function does not do any save/restore on its own. In a lazy > > + * fpu mode this is just optimization to avoid a dna fault, the task can > > + * lose FPU right after preempt_enable(). > > */ > > I cleaned it up a bit more, if you don't mind: ... > /* > - * 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(). > */ Thank! Oleg.