From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752884AbbCOUGv (ORCPT ); Sun, 15 Mar 2015 16:06:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56922 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751962AbbCOUGt (ORCPT ); Sun, 15 Mar 2015 16:06:49 -0400 Date: Sun, 15 Mar 2015 21:04:36 +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 4/4] x86/fpu: don't abuse drop_init_fpu() in flush_thread() Message-ID: <20150315200436.GA30079@redhat.com> References: <20150311173507.GF5032@redhat.com> <20150313105251.GD31998@pd.tnic> <20150313145542.GD21603@redhat.com> <20150313161958.GI31998@pd.tnic> <20150313162654.GA26453@redhat.com> <20150313192717.GJ31998@pd.tnic> <20150314144816.GA13029@redhat.com> <20150315173620.GA29134@pd.tnic> <20150315181643.GA488@redhat.com> <20150315185048.GB29134@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150315185048.GB29134@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/15, Borislav Petkov wrote: > > On Sun, Mar 15, 2015 at 07:16:43PM +0100, Oleg Nesterov wrote: > > Anyway, we're on the same page and that was a good exercise :-) Yes, finally ;) > +/* > + * In addition to "forgetting" FPU state for @tsk, we restore the > + * default FPU state in the eager case. Note, this is not needed in the > + * non-eager case because there we will set CR0.TS and fault and setup > + * an FPU state lazily. > + * > + * We restore the default FPU state in the eager case here as a means of > + * addressing the failure of restoring the FPU state which @tsk points > + * to and we still need some state to use so we use the default, clean > + * one. > + */ > static inline void drop_init_fpu(struct task_struct *tsk) > { > if (!use_eager_fpu()) But please note that it is not only used after the failure. See handle_signal() and the first drop_init_fpu() in __restore_xstate_sig(). I think its name is confusing a bit... Oleg.