Received: by 2002:a4a:301c:0:0:0:0:0 with SMTP id q28-v6csp1212286oof; Tue, 25 Sep 2018 09:40:26 -0700 (PDT) X-Google-Smtp-Source: ACcGV63Wq0afc7amVWtEVsEDFOOuv0v6a0RuJvxIFyimWP/t6NJ9sCjOpfPMmRDRqFUgwXpUCF1n X-Received: by 2002:a62:76d8:: with SMTP id r207-v6mr1991444pfc.216.1537893626742; Tue, 25 Sep 2018 09:40:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537893626; cv=none; d=google.com; s=arc-20160816; b=PKArvqM2vbRE21ozfGO6T/QZ6sc9v8eohSUOTgOibTBXMTzaOmnWtxL/U3jc+5wEdE cqovzMUvgYm7l+oShZDMRbO6kBfek21L+dRt93KQrhUQYrwh7i2Ompqr0HuwlReix1v+ M2I3ARPiLRyp2xFY/KM8uLWx8nVrm6pOtEaPG3LQM5rh7mmXnRln5Bcwl9FsGEDBq+ef IspBylJypsPuYEZjqtjNcIgkTbfqbiDK34b0hfhFCJ1A170eVLJ/wqPDNFdlMKOczADr Sod7hhnskwZeDWqu5HT9U3eQUCdtISTe8OetwA6jjtFhRxahxrQ2fyyL07Wazf+7XCKK wRcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=zkXTXKUdzrmPZs7+5Op9fbVNhPIQJTimXSmU1iV9ZC4=; b=qFA+2GmXJ2BSr78hhEtun/VOsTn74sMygwOfl73SCwjI7XD1eD4PXRHVZ/xuVDHx7W cfu0aMNY1ikftbxOAMCkuraAPnpLS/ORyJRkdVCi/wHIul5rgnBOCdaw+9mYCy9lXy0N KlVR4oWzLP+ZYt55dEYMmuOZDU1EBQBeT705ZQRyMNfLIHqMSNGXi63EXAjsEo6tHC14 nl4AqXMNfDCvW7SW4muaAuIXnGwvMa7XVEiLh2xMSlS3ggHEuIRkRhTElKjz9wnzXWcG AseO0yZjAmRjtv/07I9pa9MEq4r22IkDuGc41i7LQphT9fy+3r047QFP19d6Mz2XlPaM Rgcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="YOIcLcy/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a8-v6si2748069pgm.331.2018.09.25.09.40.10; Tue, 25 Sep 2018 09:40:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="YOIcLcy/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727361AbeIYWqh (ORCPT + 99 others); Tue, 25 Sep 2018 18:46:37 -0400 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 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=zkXTXKUdzrmPZs7+5Op9fbVNhPIQJTimXSmU1iV9ZC4=; b=YOIcLcy/52k1FSI6p7jraqu+2 9y432BDJ40c4QlgiLVWWTRh7HU0nK/RHjrVSGVLJ4NXouQZfbc8aAssX7+uyB5MlXMoyBLypx6Hjl j2NOOfziXY7xUuOGblXow9nJaBGfICa+QAuNkc8X+WRbNsNTq/dohcFftFPmH1gDb5vbqtdeHMH46 WBcdb43Wpc2DkasGnRvExTpgLrjJFQYL45liiKFGPgtCOiMxBJYdZaXCsLKWzj6W6+Wujlisd2YlP 8ETH5+3Kw4NHg0TZvvuuS8s/ZIZtHtFvOf1M/pFOwv1cVWEbsiWeVp3tES0bauTYQin8Asw4ESMza chQfIlQZg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1g4qLM-0008KZ-1G; Tue, 25 Sep 2018 16:38:08 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 0680B20289D15; Tue, 25 Sep 2018 18:37:46 +0200 (CEST) Date: Tue, 25 Sep 2018 18:37:45 +0200 From: Peter Zijlstra 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 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> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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