From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com ([192.55.52.151]:36594 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727369AbeJDWrx (ORCPT ); Thu, 4 Oct 2018 18:47:53 -0400 Message-ID: Subject: Re: [RFC PATCH v4 03/27] x86/fpu/xstate: Enable XSAVES system states From: Yu-cheng Yu Date: Thu, 04 Oct 2018 08:47:35 -0700 In-Reply-To: <20181002171554.GE29601@zn.tnic> References: <20180921150351.20898-1-yu-cheng.yu@intel.com> <20180921150351.20898-4-yu-cheng.yu@intel.com> <20181002171554.GE29601@zn.tnic> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-arch-owner@vger.kernel.org List-ID: To: Borislav Petkov Cc: x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Arnd Bergmann , Andy Lutomirski , Balbir Singh , Cyrill Gorcunov , Dave Hansen , Florian Weimer , "H.J. Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue Message-ID: <20181004154735.ONaS0t7bisiz7S-u-IHd2NRN2V047cyRfKHTw4McNTc@z> On Tue, 2018-10-02 at 19:15 +0200, Borislav Petkov wrote: > On Fri, Sep 21, 2018 at 08:03:27AM -0700, Yu-cheng Yu wrote: > > > > diff --git a/arch/x86/include/asm/fpu/xstate.h > > b/arch/x86/include/asm/fpu/xstate.h > > index 9b382e5157ed..a32dc5f8c963 100644 > > --- a/arch/x86/include/asm/fpu/xstate.h > > +++ b/arch/x86/include/asm/fpu/xstate.h > > @@ -19,10 +19,10 @@ > > #define XSAVE_YMM_SIZE 256 > > #define XSAVE_YMM_OFFSET (XSAVE_HDR_SIZE + XSAVE_HDR_OFFSET) > > > > -/* System features */ > > -#define XFEATURE_MASK_SYSTEM (XFEATURE_MASK_PT) > > Previous patch renames it, this patch deletes it. Why do we need all > that unnecessary churn? > > Also, this patch is trying to do a couple of things at once and > reviewing it is not trivial. Please split the changes logically. Yes, if we leave XFEATURE_MASK_SUPERVISOR unchanged in the previous patch, this patch becomes much simpler. Perhaps we don't even need to split this one. > > diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c > > index 19f8df54c72a..dd2c561c4544 100644 > > --- a/arch/x86/kernel/fpu/xstate.c > > +++ b/arch/x86/kernel/fpu/xstate.c > > @@ -51,13 +51,16 @@ static short xsave_cpuid_features[] __initdata = { > > }; > > > > /* > > - * Mask of xstate features supported by the CPU and the kernel: > > + * Mask of xstate features supported by the CPU and the kernel. > > + * This is the result from CPUID query, SUPPORTED_XFEATURES_MASK, > > + * and boot_cpu_has(). > > */ > > This needs to explain what both masks are - user and system. "CPU" and > "kernel" is not "user" and "all". > > > u64 xfeatures_mask_user __read_mostly; > > +u64 xfeatures_mask_all __read_mostly; The first one is all supported "user" states; the latter is "system" and "user" states combined. I will put in comments. Yu-cheng