From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752751AbbCYJKQ (ORCPT ); Wed, 25 Mar 2015 05:10:16 -0400 Received: from mail.skyhub.de ([78.46.96.112]:60422 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752139AbbCYJKJ (ORCPT ); Wed, 25 Mar 2015 05:10:09 -0400 Date: Wed, 25 Mar 2015 10:08:24 +0100 From: Borislav Petkov To: Rik van Riel Cc: Andy Lutomirski , Dave Hansen , Thomas Gleixner , "linux-kernel@vger.kernel.org" , X86 ML , Dave Hansen , Suresh Siddha , Ingo Molnar , "H. Peter Anvin" , Fenghua Yu , Oleg Nesterov Subject: Re: [PATCH 01/17] x86, fpu: wrap get_xsave_addr() to make it safer Message-ID: <20150325090824.GB3291@pd.tnic> References: <1427235664-25318-1-git-send-email-dave.hansen@intel.com> <1427235664-25318-2-git-send-email-dave.hansen@intel.com> <5511F65A.5020505@intel.com> <5511FD59.3040503@intel.com> <551208F8.1090806@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <551208F8.1090806@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 24, 2015 at 09:01:44PM -0400, Rik van Riel wrote: > Indeed, __save_init_fpu (yeah, terrible name) will save > the in-register state to memory for you, so you can > inspect it. > > Is there any reason not to rename __save_init_fpu to > save_fpu_state, or just save_fpu? That whole place there needs more rubbing. So the way I see it, the "init" thing also says that the FPU is intact. __save_fpu() does *SAVE too but it misses the FNSAVE fallback for old machines. Why TF is that so? It also doesn't do FNCLEX and IMHO the clearing of exceptions is what the "init" aspect in the name tries to imply. I think we should simply merge those into a main one called save_fpu_state() (what Rik suggests) which does all that __save_init_fpu() does currently and a low-level helper __save_fpu() which does only the *SAVE saving of context work. Meh, not ecstatic about it either but it is the cleanup worth and maybe later more stuff will collapse during further cleaning... -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply. --