From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [RFC PATCH v4 02/27] x86/fpu/xstate: Change some names to separate XSAVES system and user states Date: Tue, 25 Sep 2018 18:37:45 +0200 Message-ID: <20180925163745.GC30146@hirez.programming.kicks-ass.net> References: <20180921150351.20898-1-yu-cheng.yu@intel.com> <20180921150351.20898-3-yu-cheng.yu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20180921150351.20898-3-yu-cheng.yu@intel.com> Sender: linux-kernel-owner@vger.kernel.org To: Yu-cheng Yu 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 , Randy List-Id: linux-arch.vger.kernel.org On Fri, Sep 21, 2018 at 08:03:26AM -0700, Yu-cheng Yu wrote: > diff --git a/arch/x86/include/asm/fpu/internal.h b/arch/x86/include/asm/fpu/internal.h > index a38bf5a1e37a..f1f9bf91a0ab 100644 > --- a/arch/x86/include/asm/fpu/internal.h > +++ b/arch/x86/include/asm/fpu/internal.h > @@ -93,7 +93,8 @@ static inline void fpstate_init_xstate(struct xregs_state *xsave) > * XRSTORS requires these bits set in xcomp_bv, or it will > * trigger #GP: > */ > - xsave->header.xcomp_bv = XCOMP_BV_COMPACTED_FORMAT | xfeatures_mask; > + xsave->header.xcomp_bv = XCOMP_BV_COMPACTED_FORMAT | > + xfeatures_mask_user; I would be OK with that line extending to 82 characters.. > } > > static inline void fpstate_init_fxstate(struct fxregs_state *fx) > diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c > index 87a57b7642d3..19f8df54c72a 100644 > --- a/arch/x86/kernel/fpu/xstate.c > +++ b/arch/x86/kernel/fpu/xstate.c > @@ -421,7 +421,8 @@ static void __init setup_init_fpu_buf(void) > print_xstate_features(); > > if (boot_cpu_has(X86_FEATURE_XSAVES)) > - init_fpstate.xsave.header.xcomp_bv = (u64)1 << 63 | xfeatures_mask; > + init_fpstate.xsave.header.xcomp_bv = > + BIT_ULL(63) | xfeatures_mask_user; If you do that, the if () needs { } per coding style. > > /* > * Init all the features state with header.xfeatures being 0x0 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bombadil.infradead.org ([198.137.202.133]:38954 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726377AbeIYWqg (ORCPT ); Tue, 25 Sep 2018 18:46:36 -0400 Date: Tue, 25 Sep 2018 18:37:45 +0200 From: Peter Zijlstra Subject: Re: [RFC PATCH v4 02/27] x86/fpu/xstate: Change some names to separate XSAVES system and user states Message-ID: <20180925163745.GC30146@hirez.programming.kicks-ass.net> References: <20180921150351.20898-1-yu-cheng.yu@intel.com> <20180921150351.20898-3-yu-cheng.yu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180921150351.20898-3-yu-cheng.yu@intel.com> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Yu-cheng Yu 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 , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue Message-ID: <20180925163745.03zJccilBJLhedwNx4bvtLtBV8CCxbM2vKnZD4vTnPU@z> On Fri, Sep 21, 2018 at 08:03:26AM -0700, Yu-cheng Yu wrote: > diff --git a/arch/x86/include/asm/fpu/internal.h b/arch/x86/include/asm/fpu/internal.h > index a38bf5a1e37a..f1f9bf91a0ab 100644 > --- a/arch/x86/include/asm/fpu/internal.h > +++ b/arch/x86/include/asm/fpu/internal.h > @@ -93,7 +93,8 @@ static inline void fpstate_init_xstate(struct xregs_state *xsave) > * XRSTORS requires these bits set in xcomp_bv, or it will > * trigger #GP: > */ > - xsave->header.xcomp_bv = XCOMP_BV_COMPACTED_FORMAT | xfeatures_mask; > + xsave->header.xcomp_bv = XCOMP_BV_COMPACTED_FORMAT | > + xfeatures_mask_user; I would be OK with that line extending to 82 characters.. > } > > static inline void fpstate_init_fxstate(struct fxregs_state *fx) > diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c > index 87a57b7642d3..19f8df54c72a 100644 > --- a/arch/x86/kernel/fpu/xstate.c > +++ b/arch/x86/kernel/fpu/xstate.c > @@ -421,7 +421,8 @@ static void __init setup_init_fpu_buf(void) > print_xstate_features(); > > if (boot_cpu_has(X86_FEATURE_XSAVES)) > - init_fpstate.xsave.header.xcomp_bv = (u64)1 << 63 | xfeatures_mask; > + init_fpstate.xsave.header.xcomp_bv = > + BIT_ULL(63) | xfeatures_mask_user; If you do that, the if () needs { } per coding style. > > /* > * Init all the features state with header.xfeatures being 0x0