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

[PATCH v2] platform/cpufreq: add public defines for CPUFREQ_SHARED_TYPE_


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Date: Thu, 7 Apr 2022 10:18:28 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=lnWFLCRmcqKxtQAxn4E6pLSOOXyBQJiiTqwqs5RlTYc=; b=DuC21If1ts/jw96UOCvM4sR8C16DlouV8gPFm4MmnvmF2bKvzWahXr1DT/lRp9i1cNE0hhJMscsFwANM0lnk0PniqKoqOIqUbiLKispA0dPQ8Tn2tVkgUHb2C7idDLD9NuEd47v3COyZnjyHFHJTHbzjGSV/eMqFMw/BTEpgAWJd6wROnfsMiNRyW2+HVuEMjkzHypFnWbA1EgqUL8XwLNUwq0S/Ywp4W4L1yms5+yei9mQhs6XJNZQr8q2+jmSAe4zLsZgpUE/5ncm4sxjQu3UdqQgd7kHnDUzXJIEAMbleh88ETgCpDRr1FSsh8/5c8rNUFJQ5bTm/G/psJ4+lsw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S3sBmV9vxh1iQ8gMCnWSoV2MxsgRIMxnVlrWp8Tw4tZefCemqwJsVyDji9QAYvEmHSQAgN3dackY4FwHz4ONDbRtwaiE8m8Z9L8mLJY5T6qCik/tqOyyx/0W390DOeKMF4RjrW0jgWI3dqbyVAsAHiXqnWnHXCmYK8OJ2STW21N9ED75e5lgMJiMvfGXWG+gvmXWul+sg8zA4/oTFN4oGI0c8Tc/EsLCUJHBSPUIYwPzne8Qyo1dgOr18J5HCOY3Pfd3BM3c7Au9Hhyml8QJrI4/aFfAhingXd+dNmdJcEN6ADEV3T8yCrru2mQxm5VPZgbQfPF6zW0zaUKrEn0fhQ==
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Thu, 07 Apr 2022 08:19:00 +0000
  • Ironport-data: A9a23:45DzuKN8beG7Mg3vrR2Zl8FynXyQoLVcMsEvi/4bfWQNrUoq12RSz mYeCjiAPfrbZGamfdgiPI2w80JVuJWGmtVnTAto+SlhQUwRpJueD7x1DKtR0wB+jCHnZBg6h ynLQoCYdKjYdleF+lH1dOKJQUBUjclkfJKlYAL/En03FFcMpBsJ00o5wbZl2tEw2LBVPivW0 T/Mi5yHULOa82Yc3lI8s8pvfzs24ZweEBtB1rAPTagjUG32zhH5P7pGTU2FFFPqQ5E8IwKPb 72rIIdVXI/u10xF5tuNyt4Xe6CRK1LYFVDmZnF+A8BOjvXez8CbP2lS2Pc0MC9qZzu1c99Zm OgKrIaVTCkQDqjnw7gCThdIHiQlMvgTkFPHCSDXXc27ykTHdz3nwul0DVFwNoodkgp1KTgQr 7pCcmlLN03dwbLtqF64YrAEasALNs7kMZlZonh95TrYEewnUdbIRKCiCdpwgmdu2p0VRKm2i 8wxRwFiZRLBTg12ZU5JK59mvumur1X9bGgNwL6SjfVuuDWCpOBr65D2K8bccNGOQcRTn26bq 3jA8mC/BQsVXPSAzRKV/3TqgfXA9Qv5RYYTGbuQ5vNsxl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5pnIkjKo6k2Ffa40Dc7VcxLZvtn+9KK1wUx4S1bpXXt WHVKrnlbdrmBKhHjvkV1BUsZCRti9ZJGbHfqAA0vbloQS+0koJjHfw//Zv70voxKhNNaWs2N 60QpiA7Is+NvP+TZgNcNvpEvHHfVAkf3r3QRGvyBLcZeM6B04=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

The values set in the shared_type field of xen_processor_performance
have so far relied on Xen and Linux having the same
CPUFREQ_SHARED_TYPE_ defines, as those have never been part of the
public interface.

Formalize by adding the defines for the allowed values in the public
header, while renaming them to use the XEN_CPUPERF_SHARED_TYPE_ prefix
for clarity.

Set the Xen internal defines for CPUFREQ_SHARED_TYPE_ using the newly
introduced XEN_CPUPERF_SHARED_TYPE_ public defines in order to avoid
unnecessary code churn.  While there also drop
CPUFREQ_SHARED_TYPE_NONE as it's unused.

Fixes: 2fa7bee0a0 ('Get ACPI Px from dom0 and choose Px controller')
Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
Changes since v1:
 - Keep CPUFREQ_SHARED_TYPE_ and define them on top of
   XEN_CPUPERF_SHARED_TYPE_.
 - Use CPUPERF instead of plain PERF.
---
 xen/include/acpi/cpufreq/cpufreq.h | 7 +++----
 xen/include/public/platform.h      | 6 +++++-
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/xen/include/acpi/cpufreq/cpufreq.h 
b/xen/include/acpi/cpufreq/cpufreq.h
index e5e58c6c30..35dcf21e8f 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -78,10 +78,9 @@ DECLARE_PER_CPU(struct cpufreq_policy *, cpufreq_cpu_policy);
 extern int __cpufreq_set_policy(struct cpufreq_policy *data,
                                 struct cpufreq_policy *policy);
 
-#define CPUFREQ_SHARED_TYPE_NONE (0) /* None */
-#define CPUFREQ_SHARED_TYPE_HW   (1) /* HW does needed coordination */
-#define CPUFREQ_SHARED_TYPE_ALL  (2) /* All dependent CPUs should set freq */
-#define CPUFREQ_SHARED_TYPE_ANY  (3) /* Freq can be set from any dependent 
CPU*/
+#define CPUFREQ_SHARED_TYPE_HW   XEN_CPUPERF_SHARED_TYPE_HW
+#define CPUFREQ_SHARED_TYPE_ALL  XEN_CPUPERF_SHARED_TYPE_ALL
+#define CPUFREQ_SHARED_TYPE_ANY  XEN_CPUPERF_SHARED_TYPE_ANY
 
 /******************** cpufreq transition notifiers *******************/
 
diff --git a/xen/include/public/platform.h b/xen/include/public/platform.h
index a4c0eb6224..8100133509 100644
--- a/xen/include/public/platform.h
+++ b/xen/include/public/platform.h
@@ -465,7 +465,11 @@ struct xen_processor_performance {
     uint32_t state_count;     /* total available performance states */
     XEN_GUEST_HANDLE(xen_processor_px_t) states;
     struct xen_psd_package domain_info;
-    uint32_t shared_type;     /* coordination type of this processor */
+    /* Coordination type of this processor */
+#define XEN_CPUPERF_SHARED_TYPE_HW   1 /* HW does needed coordination */
+#define XEN_CPUPERF_SHARED_TYPE_ALL  2 /* All dependent CPUs should set freq */
+#define XEN_CPUPERF_SHARED_TYPE_ANY  3 /* Freq can be set from any dependent 
CPU */
+    uint32_t shared_type;
 };
 typedef struct xen_processor_performance xen_processor_performance_t;
 DEFINE_XEN_GUEST_HANDLE(xen_processor_performance_t);
-- 
2.35.1




 


Rackspace

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