[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 01/11] xen/x86: add CPPC feature flag for AMD processors


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Penny Zheng <Penny.Zheng@xxxxxxx>
  • Date: Thu, 6 Feb 2025 16:32:45 +0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=41y8sec6nqUyzgRa9rWZO3TQWkVErDGbU7dAJLNct/4=; b=wzn2mQw9VVzGe97WJuBI/EzoL1MjAsxePrBTkHpqvzA1sNUvL2gVUkQXnXf2+14VOltUMzwWwbK1J5YTi0OwcbMLEsTZuDZ7ZtQ0+7hgYaUwpRnydJcICJvSaPAUP0Z1pyeYa5WFUKooM2XTFJPdDclFu+bjNtutrUWG8LfY5gPKed5rWKSH/H8FtDG3dG6CVrkF6du0dyX9vvhGAvUY9oXXLg3jijIl4OlH9l8v1H0u2q5PpOE14xSUTIZiiSXxdNuUuWZ0HN8qOLBDgWmKsklyeqA3u5uegKxq6oFBw8VPIgzxCk3n75MHMbxSUkqoI9lUsykqYxl7z3ygEjIrCA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wx/jreXkk7dC5sXQUM0Y2IYpzUOxOEWgWG6VXE0+32ltIRglNW7LhD2y07XLVG+CBqLC3Eba9ek5mvjQw4ftqKcA/PYksfPX/2g6nk61Nq6QT1DCgPjHp1p2HfNws7qoRlRB9uXtbqNPh5MY0yt/vBDnwFXEn6b7303bVGaohaz6+DdirfXSvSvlOp09kHumNrBk7WV28KxVIq08kuz84SeeZPvIftli6Fw+DZbVjPo9JxdUQCqR0skI2mN5rnCPhYhjNLHaQ0pnPb8n06bXFcpOEDOz5RsPzRLgzVwZ9bqJjw3TbXeF4BWzKTSrKTn/rp1PuQyYgoeF1EKin8C7Ww==
  • Cc: <Ray.Huang@xxxxxxx>, <Jason.Andryuk@xxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Thu, 06 Feb 2025 08:33:32 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Add Collaborative Processor Performance Control feature flag for
AMD processors.

amd-cppc is the AMD CPU performance scaling driver that
introduces a new CPU frequency control mechanism on modern AMD
APU and CPU series.
There are two types of hardware implementations: "Full MSR Support"
and "Shared Memory Support".

Right now, xen will only implement "Full MSR Support", and this new
feature flag indicates whether processor has this feature or not.

Signed-off-by: Penny Zheng <Penny.Zheng@xxxxxxx>
---
v1 -> v2:
- Remove A flag, as the feature is Xen-only
---
 xen/arch/x86/include/asm/cpufeature.h       | 1 +
 xen/include/public/arch-x86/cpufeatureset.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/xen/arch/x86/include/asm/cpufeature.h 
b/xen/arch/x86/include/asm/cpufeature.h
index 3a06b6f297..6935703e71 100644
--- a/xen/arch/x86/include/asm/cpufeature.h
+++ b/xen/arch/x86/include/asm/cpufeature.h
@@ -170,6 +170,7 @@ static inline bool boot_cpu_has(unsigned int feat)
 #define cpu_has_amd_ssbd        boot_cpu_has(X86_FEATURE_AMD_SSBD)
 #define cpu_has_virt_ssbd       boot_cpu_has(X86_FEATURE_VIRT_SSBD)
 #define cpu_has_ssb_no          boot_cpu_has(X86_FEATURE_SSB_NO)
+#define cpu_has_cppc            boot_cpu_has(X86_FEATURE_CPPC)
 #define cpu_has_auto_ibrs       boot_cpu_has(X86_FEATURE_AUTO_IBRS)
 
 /* CPUID level 0x00000007:0.edx */
diff --git a/xen/include/public/arch-x86/cpufeatureset.h 
b/xen/include/public/arch-x86/cpufeatureset.h
index 16207e3817..cc6e984a88 100644
--- a/xen/include/public/arch-x86/cpufeatureset.h
+++ b/xen/include/public/arch-x86/cpufeatureset.h
@@ -265,6 +265,7 @@ XEN_CPUFEATURE(AMD_PPIN,      8*32+23) /*   Protected 
Processor Inventory Number
 XEN_CPUFEATURE(AMD_SSBD,      8*32+24) /*S  MSR_SPEC_CTRL.SSBD available */
 XEN_CPUFEATURE(VIRT_SSBD,     8*32+25) /*!  MSR_VIRT_SPEC_CTRL.SSBD */
 XEN_CPUFEATURE(SSB_NO,        8*32+26) /*A  Hardware not vulnerable to SSB */
+XEN_CPUFEATURE(CPPC,          8*32+27) /*   Collaborative Processor 
Performance Control */
 XEN_CPUFEATURE(PSFD,          8*32+28) /*S  MSR_SPEC_CTRL.PSFD */
 XEN_CPUFEATURE(BTC_NO,        8*32+29) /*A  Hardware not vulnerable to Branch 
Type Confusion */
 XEN_CPUFEATURE(IBPB_RET,      8*32+30) /*A  IBPB clears RSB/RAS too. */
-- 
2.34.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.