Received: by 2002:ab2:6f44:0:b0:1fd:c486:4f03 with SMTP id l4csp127051lqq; Wed, 12 Jun 2024 19:57:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXa5z7Vz1canY3zmBSyJV5+XGl+SeV5goeVBHd26Eeim2Hgloaax0CW8YgVymSESz/WrsakShB8Sw1RbCc+QZY325z9jWFQHqx4RiALqQ== X-Google-Smtp-Source: AGHT+IEyZgzV3e8BRXHljgms1brC0/Gl0XqRqcgtBzDA6omkUBex4/mvJxdbK1tqJlSyuPfmuxZm X-Received: by 2002:a05:620a:618b:b0:794:eb81:32c4 with SMTP id af79cd13be357-798100f1f2emr222659185a.10.1718247470950; Wed, 12 Jun 2024 19:57:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718247470; cv=pass; d=google.com; s=arc-20160816; b=Y0e4ukX8yqkZ19HhNyFf5HXDiUSnwbVQigZxGAHr5/OYnvql9o3H0nJDrmDDewt3Xx mpsmPIoZNykLQOXXpJJC5/RmYk9McwbovXgtn2XZofDa6K7X+svJI/v3HcCyOAbGGVC4 2lShNvL8w37u4yy/2nJcerlb/+243+ZfNvLAAvK9fahschf3ErDyDAxeLEQTyO8JgXtL p5KVs3QDWkQUN+d9ix6N/Ac7DQcEo4iaI1KwSQkCvz2w+pikRODESPQ97e4k6dipJIdW S05qor6ulNAAE1YSxFbAGdecRs5gaw0IRRBS5GQ78usYNWrW242LH7NlkRJWRHfG5RNF rBOw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature:dkim-filter; bh=vQd3vUyfsayygHgkM5vM2MNlvWp19CaBHld+FXf7POM=; fh=muWSORHzvlQWyQ9247A8RY88sJfgtMD7ohLtPloR504=; b=AwE6DGTF/HsASvOP81nS25Jy2d5q2mqSrsuDjQaj+VsX9DX1epfYfiIhFIDCF1ngi5 ws+v34kmtmIThV+G3raBjT82gIHu9ruNEGss85ghiKBSzFN03XbiCzKD6R9r9CJede1E 4EJ1No5LyGCmIF5SG/u9w4GOcpYSm5/XYbrLUUTVEyoH0QhqL2ksab5dBGSZcLrQVFfn HrbhIsHUGs+klxg/C5rr4yY00syirlYBPVyRZg7eE07b9EuLtskfcObFXtgrOgD3mKVq d55yiHD/gTBJEsF5UiE94UUeLiVRCZzTCaq9LW3YPtNmBU2gsyly8TOMgiJ7vM7kSsJi RJSQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@zytor.com header.s=2024051501 header.b=BXBg2aSC; arc=pass (i=1 spf=pass spfdomain=zytor.com dkim=pass dkdomain=zytor.com dmarc=pass fromdomain=zytor.com); spf=pass (google.com: domain of linux-kernel+bounces-212508-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212508-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-798aadbe7bfsi43661885a.181.2024.06.12.19.57.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 19:57:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-212508-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@zytor.com header.s=2024051501 header.b=BXBg2aSC; arc=pass (i=1 spf=pass spfdomain=zytor.com dkim=pass dkdomain=zytor.com dmarc=pass fromdomain=zytor.com); spf=pass (google.com: domain of linux-kernel+bounces-212508-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212508-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id AB8AA1C21493 for ; Thu, 13 Jun 2024 02:57:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D46AB12D1F6; Thu, 13 Jun 2024 02:57:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b="BXBg2aSC" Received: from mail.zytor.com (terminus.zytor.com [198.137.202.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C8BE6126F1D; Thu, 13 Jun 2024 02:57:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.136 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718247464; cv=none; b=lklrBU9lAx6okyrqawuBdJmYLoo1gMLC3WiGtEK/QjPnk7D9H5fqtLfk0frVEKtmWco/xpZHRCQnPv0/fLR7QAz4cZGCGEK8Kn6PL17Ek3/UcOmnsqeCJV9DQiWd9uRGvCBf+zsf64+zmwROxwTZGxRKJr32iRy2SgTtxiCRCWo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718247464; c=relaxed/simple; bh=TLL7Vi4AXjbV0h+Rp+oTDPJbtBaUErrOe9Swh52bSwo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=R+R4jv2xqZjKxZbpVjqpS0aM0CpjU5EBuvQRTY/rSgvgsoH05pM0VH/1SfwNMR7CwSkBSl1mOV0t6wKpq5t2Pe06A8ksq4RXziE6I1wab94qtIrV9AEW6rUbiIhkCkvroANG3jY7EI0Nqhm0alJ/2HYvV135c5XuL4i7XkmglAE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com; spf=pass smtp.mailfrom=zytor.com; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b=BXBg2aSC; arc=none smtp.client-ip=198.137.202.136 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zytor.com Received: from [0.0.0.0] ([134.134.137.76]) (authenticated bits=0) by mail.zytor.com (8.17.2/8.17.1) with ESMTPSA id 45D2uYQl3987160 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Wed, 12 Jun 2024 19:56:35 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 45D2uYQl3987160 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2024051501; t=1718247397; bh=vQd3vUyfsayygHgkM5vM2MNlvWp19CaBHld+FXf7POM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=BXBg2aSCEhzk2RvuSnVO0dJBYl4slJiiWnlYi4TuGGDOoze45N+zfoscff9daak2V DfThAqiqZwkTySyJ4/LN9SQYQVXgL7MkIYPzNUllsL629ysmcVZBvZfiX7bYQUanp2 Ku9nxoPOLH8u5Zpp9zej6hpAQNKsZASwXvOMNVOdr7GzUJuFYZDPan14Ad/YF2DgeQ vadXv3MSroQfyBFL2QHM3nQ3QZBeLNYY4TLJLTGQhvvrZtyILLD9vHNfcDp586q4zB KObZ0/Xq4iiFpiN8Cwq26xUJu4LNTnlkddHfhPtC4Mpq9TYhzYORGujpPUmeAK8j50 5UIGU/oHdxDdQ== Message-ID: <7bf64b12-ea59-470c-ac31-8226be4eb496@zytor.com> Date: Wed, 12 Jun 2024 19:56:28 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RESEND v1 1/3] x86/cpufeatures: Add {required,disabled} feature configs To: Borislav Petkov Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, will@kernel.org, peterz@infradead.org, akpm@linux-foundation.org, acme@kernel.org, namhyung@kernel.org References: <20240509205340.275568-1-xin@zytor.com> <20240509205340.275568-2-xin@zytor.com> <20240612133340.GBZmmjtD40dzhsWVyg@fat_crate.local> Content-Language: en-US From: Xin Li Autocrypt: addr=xin@zytor.com; keydata= xsDNBGUPz1cBDACS/9yOJGojBFPxFt0OfTWuMl0uSgpwk37uRrFPTTLw4BaxhlFL0bjs6q+0 2OfG34R+a0ZCuj5c9vggUMoOLdDyA7yPVAJU0OX6lqpg6z/kyQg3t4jvajG6aCgwSDx5Kzg5 Rj3AXl8k2wb0jdqRB4RvaOPFiHNGgXCs5Pkux/qr0laeFIpzMKMootGa4kfURgPhRzUaM1vy bsMsL8vpJtGUmitrSqe5dVNBH00whLtPFM7IbzKURPUOkRRiusFAsw0a1ztCgoFczq6VfAVu raTye0L/VXwZd+aGi401V2tLsAHxxckRi9p3mc0jExPc60joK+aZPy6amwSCy5kAJ/AboYtY VmKIGKx1yx8POy6m+1lZ8C0q9b8eJ8kWPAR78PgT37FQWKYS1uAroG2wLdK7FiIEpPhCD+zH wlslo2ETbdKjrLIPNehQCOWrT32k8vFNEMLP5G/mmjfNj5sEf3IOKgMTMVl9AFjsINLHcxEQ 6T8nGbX/n3msP6A36FDfdSEAEQEAAc0WWGluIExpIDx4aW5Aenl0b3IuY29tPsLBDQQTAQgA NxY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CLVQcgU4glo17vqfEaRcTW5SgX+pGs4KIPPBE5J/ABD6pBnUUAEQEAAcLA/AQYAQgA JhYhBIUq/WFSDTiOvUIqv2u9DlcdrjdRBQJlD89ZBQkFo5qAAhsMAAoJEGu9DlcdrjdR4C0L /RcjolEjoZW8VsyxWtXazQPnaRvzZ4vhmGOsCPr2BPtMlSwDzTlri8BBG1/3t/DNK4JLuwEj OAIE3fkkm+UG4Kjud6aNeraDI52DRVCSx6xff3bjmJsJJMb12mWglN6LjdF6K+PE+OTJUh2F dOhslN5C2kgl0dvUuevwMgQF3IljLmi/6APKYJHjkJpu1E6luZec/lRbetHuNFtbh3xgFIJx 2RpgVDP4xB3f8r0I+y6ua+p7fgOjDLyoFjubRGed0Be45JJQEn7A3CSb6Xu7NYobnxfkwAGZ Q81a2XtvNS7Aj6NWVoOQB5KbM4yosO5+Me1V1SkX2jlnn26JPEvbV3KRFcwV5RnDxm4OQTSk PYbAkjBbm+tuJ/Sm+5Yp5T/BnKz21FoCS8uvTiziHj2H7Cuekn6F8EYhegONm+RVg3vikOpn gao85i4HwQTK9/D1wgJIQkdwWXVMZ6q/OALaBp82vQ2U9sjTyFXgDjglgh00VRAHP7u1Rcu4 l75w1xInsg== In-Reply-To: <20240612133340.GBZmmjtD40dzhsWVyg@fat_crate.local> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 6/12/2024 6:33 AM, Borislav Petkov wrote: > On Thu, May 09, 2024 at 01:53:38PM -0700, Xin Li (Intel) wrote: >> diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu >> index 2a7279d80460..719302d37053 100644 >> --- a/arch/x86/Kconfig.cpu >> +++ b/arch/x86/Kconfig.cpu >> @@ -358,6 +358,10 @@ config X86_P6_NOP >> depends on X86_64 >> depends on (MCORE2 || MPENTIUM4 || MPSC) >> >> +config X86_REQUIRED_FEATURE_NOPL > > Can we keep the X86_{REQUIRED,DISABLED}_ prefixes solely in > arch/x86/Kconfig.cpufeatures and not spill them out into the rest of the tree? Good point, let me try. > > This way there will be no confusion between X86_FEATURE_, X86_REQUIRED_FEATURE_, > X86_DISABLED_FEATURE_ and so on, and which one I am supposed to use where... Currently X86_DISABLED_FEATURE_ macros are defined only in: arch/x86/Kconfig.cpufeatures. But X86_REQUIRED_FEATURE_ macros are not. >> diff --git a/arch/x86/Kconfig.cpufeatures b/arch/x86/Kconfig.cpufeatures >> new file mode 100644 >> index 000000000000..326a8410ff06 >> --- /dev/null >> +++ b/arch/x86/Kconfig.cpufeatures >> @@ -0,0 +1,153 @@ >> +# SPDX-License-Identifier: GPL-2.0 >> +# >> +# x86 feature bits (see arch/x86/include/asm/cpufeatures.h) that are >> +# either REQUIRED to be enabled, or DISABLED (always ignored) for this >> +# particular compile-time configuration. The tests for these features >> +# are turned into compile-time constants via the generated >> +# . >> +# >> +# The naming of these variables *must* match asm/cpufeatures.h. > > I presume they must match X86_FEATURE_? Right, let me add this. > > And REQUIRED and DISABLED is manipulated in by the script? > > I guess I'll see later. Yep! Thanks! Xin