From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38F36C63777 for ; Mon, 30 Nov 2020 18:17:16 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AD9292074A for ; Mon, 30 Nov 2020 18:17:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AD9292074A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E7F188D0003; Mon, 30 Nov 2020 13:17:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E561A8D0001; Mon, 30 Nov 2020 13:17:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D6CBD8D0003; Mon, 30 Nov 2020 13:17:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0212.hostedemail.com [216.40.44.212]) by kanga.kvack.org (Postfix) with ESMTP id C062D8D0001 for ; Mon, 30 Nov 2020 13:17:14 -0500 (EST) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 83E2B2C2A for ; Mon, 30 Nov 2020 18:17:14 +0000 (UTC) X-FDA: 77541891588.12.cakes74_560192d273a4 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin12.hostedemail.com (Postfix) with ESMTP id 43C131801D201 for ; Mon, 30 Nov 2020 18:17:14 +0000 (UTC) X-HE-Tag: cakes74_560192d273a4 X-Filterd-Recvd-Size: 4220 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Mon, 30 Nov 2020 18:17:12 +0000 (UTC) IronPort-SDR: 3WzVz2GLEjp/i4oDHwBWXD3BTwbdwRnEnvrFUUcZ6NBgDGQc/odufdtYdddzNsBFMr+SMSJha6 bWRCIDGGAcGw== X-IronPort-AV: E=McAfee;i="6000,8403,9821"; a="159737496" X-IronPort-AV: E=Sophos;i="5.78,382,1599548400"; d="scan'208";a="159737496" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2020 10:17:11 -0800 IronPort-SDR: Po7ha/fJ6IXwregsxpli6VTfXr+znPuolwEztJizbK2473bykZTG02oYFxl670BEDxM3PIUpwE f6imrB/W1kIA== X-IronPort-AV: E=Sophos;i="5.78,382,1599548400"; d="scan'208";a="434379152" Received: from yyu32-mobl1.amr.corp.intel.com (HELO [10.212.122.22]) ([10.212.122.22]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2020 10:17:09 -0800 Subject: Re: [NEEDS-REVIEW] [PATCH v15 03/26] x86/fpu/xstate: Introduce CET MSR XSAVES supervisor states To: Dave Hansen , 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 , Borislav Petkov , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , 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 , Dave Martin , Weijiang Yang , Pengfei Xu References: <20201110162211.9207-1-yu-cheng.yu@intel.com> <20201110162211.9207-4-yu-cheng.yu@intel.com> <31c8dabc-185d-be7b-c800-30a7ff29b34e@intel.com> From: "Yu, Yu-cheng" Message-ID: <0110eba0-09cd-ace8-57d3-859475610b42@intel.com> Date: Mon, 30 Nov 2020 10:17:09 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: <31c8dabc-185d-be7b-c800-30a7ff29b34e@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 11/30/2020 10:12 AM, Dave Hansen wrote: > On 11/30/20 10:06 AM, Yu, Yu-cheng wrote: >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = if (!boot_cpu_has(X86_FEATURE_SHSTK) && >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 !boot_cpu_has(X86_FEATURE_IBT)) >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 xfeatures_mask_all &=3D ~BIT_ULL(i); >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } else { >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = if ((xsave_cpuid_features[i] =3D=3D -1) || >>> >>> Where did the -1 come from?=C2=A0 Was that introduced earlier in this= series? >>> =C2=A0 I don't see any way a xsave_cpuid_features[] can be -1 in the >>> current tree. >> >> Yes, we used to have a hole in xsave_cpuid_features[] and put -1 there= . >> Do we want to keep this in case we again have holes in the future? >=20 > So, it's dead code for the moment and it's impossible to tell what -1 > means without looking at git history? That seems, um, suboptimal. >=20 > Shouldn't we have: >=20 > #define XFEATURE_NO_DEP -1 >=20 > ? >=20 > And then this code becomes: >=20 > if ((xsave_cpuid_features[i] =3D=3D XFEATURE_NO_DEP)) > // skip it... >=20 > We can even put a comment in xsave_cpuid_features[] to tell folks to us= e > it. >=20 Yes, I will work on that. Yu-cheng