Received: by 2002:a4a:301c:0:0:0:0:0 with SMTP id q28-v6csp1245503oof; Tue, 25 Sep 2018 10:06:34 -0700 (PDT) X-Google-Smtp-Source: ACcGV633LhoicHvrd4/pZR2K03DDke8QrDjzmEGIB/ilAnNbYlViQwS7/pcQLy7ULf18r/Z7bXGR X-Received: by 2002:a62:9c17:: with SMTP id f23-v6mr2030953pfe.209.1537895194258; Tue, 25 Sep 2018 10:06:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537895194; cv=none; d=google.com; s=arc-20160816; b=EGhwP0LKtz/+W/cwfcGP5pD9F7EEzRRWNbxrKNyd2T+DIPAkd8DtxYe6fkH8W2pBKq TbgLqzI1okhQ/vpGgNZYIsv9IUXirct9q7wxTcw4naYYHfuVvsZ9Xj/tD+o0bq/LDikl X3UWbyHiIGm+G3Mt2A++0DDB5XNVZGNEHCgUgOHMqW5ZKxWoWWcrsVotD+U/YPQMS1HQ Ukc845pMWYrctsB4/aqntDhCJg3pmxcR0So1k1IpwnYkceETZ21q+uKNtmeli+T0O6Bk b7VyvJktOKcFYCJNFabQ7CnM5v3gLmbcbmakUbPDOw6F4fjRWk9ec2aOigFs71rZ6RWr ivxA== 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=XsmIVRHdh3Wn1iEaJpNxeLAZHl9WUmDC2Sfg61xGq3w=; b=Ue4RE4bFFCbZ8k3VedcfAYxGh+g01bFy1VxS6zeY6vaRjjOuWLxSmhmekPwzXLabTb vBiyq+Lf2xAMNhYMoDmgg6PH1Qosw+cPVi0z5XyRKhdILcjnibsiGBBbi3Y/l9/BZOUj jJOjV3KixGe6aPplrl/uQ4DrlvUTYM0oc000v2DFDUzVq5pmkYN1cfwhyjUQwAG6rUvN oJSjlgcXd0lMRADYffMP4RI5HJOOeiGQsjZ25xUApSyWlHQSeU3PQMAh3OFDkst9UKw9 cXblUApR9VPAeaYONOpyJarpsV/GfI2x9AIO6UsqvvBZJ9AOgguKPvXrCS5ydBQxphsH kCUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=jreFG2MW; 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 i10-v6si2882792pgb.71.2018.09.25.10.06.17; Tue, 25 Sep 2018 10:06:34 -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=jreFG2MW; 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 S1727338AbeIYXM4 (ORCPT + 99 others); Tue, 25 Sep 2018 19:12:56 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:49458 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726322AbeIYXM4 (ORCPT ); Tue, 25 Sep 2018 19:12:56 -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=XsmIVRHdh3Wn1iEaJpNxeLAZHl9WUmDC2Sfg61xGq3w=; b=jreFG2MWGnTgYSaN9+coo8mG9 ZdiZdiF9twVfcfX/8GJlt9YhLFHoXFv/raa20GuInpD75t0HhduTzJ7R+p01fGk8oae0Xs9Bst7Az Yq/9vGqh4pwsmBP+W/MMbrsv5ipDgAzyz9r6qS2x18GAasDEpe7FfUiAYmqoiP8zeZA2Ir7mY6Hvk HLrHcwj4B5+k6H1/8uK0MgKLrmlpuoWnjWjUlWcDO7o7SlWq6231btOYBXi0rE2mp9YbZZsPoPEwE bMPE4++AcN4qgJOdj2hDZ+Rn5d6VbDgvNIWxkpu/gIFAWeWbJRd6rB8xa+z8KNPETjXPDxP1qIzmR Y/1bvc7Mw==; 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 1g4qkh-0005oV-9w; Tue, 25 Sep 2018 17:04:16 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 380FC2025445D; Tue, 25 Sep 2018 19:03:55 +0200 (CEST) Date: Tue, 25 Sep 2018 19:03:55 +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 03/27] x86/fpu/xstate: Enable XSAVES system states Message-ID: <20180925170355.GD30146@hirez.programming.kicks-ass.net> References: <20180921150351.20898-1-yu-cheng.yu@intel.com> <20180921150351.20898-4-yu-cheng.yu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180921150351.20898-4-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:27AM -0700, Yu-cheng Yu wrote: > diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c > index 4bd56079048f..9f51b0e1da25 100644 > --- a/arch/x86/kernel/fpu/core.c > +++ b/arch/x86/kernel/fpu/core.c > @@ -365,8 +365,13 @@ void fpu__drop(struct fpu *fpu) > */ > static inline void copy_init_user_fpstate_to_fpregs(void) > { > + /* > + * Only XSAVES user states are copied. > + * System states are preserved. > + */ > if (use_xsave()) > - copy_kernel_to_xregs(&init_fpstate.xsave, -1); > + copy_kernel_to_xregs(&init_fpstate.xsave, > + xfeatures_mask_user); By my counting, that doesn't qualify for a line-break, it hits 80. If you were to do this line-break, coding style would have you liberally sprinkle {} around. > else if (static_cpu_has(X86_FEATURE_FXSR)) > copy_kernel_to_fxregs(&init_fpstate.fxsave); > else