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

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


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Penny Zheng <Penny.Zheng@xxxxxxx>
  • Date: Tue, 3 Dec 2024 16:11:01 +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=gcv16TAN0uUZcF80nkgtKyHscsZfjQCW9TkOZr32cuk=; b=h5c1MQtaT0tNABSc3OsHz2IOLIrgrtA1s3LbPSiXNMqnsSLWAA5Wi5B/OQiVTwo1LHvwy6zMWZKUq1elrNB1rwPqY7caMvxUGtI//mmCAmNGhTB4H2a7GkSAMWPIwfFZ5p7qf+OtAQ0ztg4wt0mLPsHSnjOKTXES0C+3hrdSKNj2qfwHkKJHdlpdDBLL5iQpED1zULz6RhTDzjDmq3vtGhppCIORz6yI6qP0LBeRSRCquCzz9w9Tw9hah2bbH55RSuUhz+Hd6iHy/MUzYKmdhLdlMSlOfrdKwKbqfKVTfA/0CiNRpznZQXXtKkRyfQSBOaLA3v4D4Yq5V5H8ZOKsNw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QD5I0XmGN/cozyynmRCQly4xwqQFuFWu40PVHdzdOuR3O55htGbVJkr+d1e+noOt4wdG08eKK2IEtb56pkE+U+f9kDOevxEBu3yLK4CFP404fnqDps/2dj0kEqmfHK532co+3+wFOt0iMxuu/Ak40dqh9HamT0Nd68f5Q2HKSlMPYUkeSgyRK6QJKvul4QHARJ4WewBsy/WTbTtzfLZa90POcqbU/dA9jy0K90e8zR08kJGvPgZ+sYw9hfYomcYG30UyHutR3c/p5ud4uAPNejIt02O93Z9ZWXV7DLgR+JqwJxWVXr0FamkKjyJVY9ySs1JWQd5f656Sd0VZbm6h9g==
  • Cc: <stefano.stabellini@xxxxxxx>, <Ray.Huang@xxxxxxx>, <Xenia.Ragiadakou@xxxxxxx>, <Jason.Andryuk@xxxxxxx>, <penny.zheng@xxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, "Andrew Cooper" <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Tue, 03 Dec 2024 08:22:09 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Add Collaborative Processor Performance Control feature flag for
AMD processors.

amd-pstate 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>
---
 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 8fa3fb711a..15f707639b 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) /*A  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®.