Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1148628imm; Thu, 4 Oct 2018 08:54:41 -0700 (PDT) X-Google-Smtp-Source: ACcGV61Pdy6j4dumMI11xawL6p18c8AsRaoi/tTSL0/hrZu8lE1KpkuUzx51kAcBtNbN/Sj1i5Qe X-Received: by 2002:a65:655a:: with SMTP id a26-v6mr6248586pgw.389.1538668481283; Thu, 04 Oct 2018 08:54:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538668481; cv=none; d=google.com; s=arc-20160816; b=UX3cEUli5kBCa8YQbLAfh8yic7Q80ywQ/x/pfQ/KNg/H9BlNvc5WPDvy+FV0Bz9FAV GbpBVRsZVtfQ11nOAUnXmkEa54uiKDDdEClW0g1rpYVrUN2O3Zk1yjZFd1bHpEJ+yUgh GxU38PSNLS4l+7rtzEzOz2TBqm2IWqJzHspp6vREU+C72o82DqlhB6FZvaXiXP66cdna VuisMb+eMjtd1ZMCEpku2lbYBvNNS7fI3rZ1WP7gsZf987Ch7LKjJ/cr5LDpfbOdKq8u GVw6Rmfr/49ZavHIxNDkA6mX4LErsfIzbKz30fBvq/P34EYg041l/skcDcoBqvw1F822 9QHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=GI+piy1nE3g3w6/iFroVjgzdJkEMlnIhAJ3O629e+Jc=; b=oICBmQ1fsidwTESTnVE5n5rrtuYPQg6rvxaI8HxTvsZVoASRUrhpG2b4oPldTY4M+Q thYJNEH51vJDK7GiosahFyaBzxzye2p+/fTQqFdQ/H4XywBNowv3ME/Hyz+Zokm3PW9d wCtnmXTPp7NOutSBJXamZDoC1M8TDCtMIiD4DdM6fuD0ZKFp9wGxcm1yn4CCMhe0u0vy E7WAmwOO3k7AiMVjpLLKJ8Msvw+u0CPbG9dNxGlE7FCaMN7hDB3phkzFDIoEhEoHuNcj olYremw69srejFgHeQ4/j+fSUmSviJjBuikl8SVWMwa3CkPhhNauMZDMOXH5wEYQZAMT MC8A== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b16-v6si4962945pgk.358.2018.10.04.08.54.25; Thu, 04 Oct 2018 08:54:41 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727721AbeJDWry (ORCPT + 99 others); Thu, 4 Oct 2018 18:47:54 -0400 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 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Oct 2018 08:54:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,340,1534834800"; d="scan'208";a="79879490" Received: from 2b52.sc.intel.com ([143.183.136.147]) by orsmga006.jf.intel.com with ESMTP; 04 Oct 2018 08:52:16 -0700 Message-ID: Subject: Re: [RFC PATCH v4 03/27] x86/fpu/xstate: Enable XSAVES system states From: Yu-cheng Yu 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 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" X-Mailer: Evolution 3.28.1-2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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