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

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


  • To: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 6 Apr 2022 17:31:22 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=NQdpJ0VMc9SRfY2HnOWzylGnWbVgiwJi8Dx+yrakyaQ=; b=KfUAKDJ07GSCiSPDCTDGAyT28yUZAr9x0El8tZLkCopEVBhI5Cw9cEZPfncVEmHS0QzQ7yiThgSa3sZIZXTvaF55EHqFPE1UY+F9YjrcIvswKHRTkAcUKmGr9XkrWWmlwc/og8KrwyRAvqCzDKa8A786/c626WYZT2OoWt8dqSCjDvt/dOQrYBp/KXsfGHGyKfhtLbDyPNkL0C9jKWTp9aCXlQhgF8E/VE9iIT3CTLCclMssVN0FgSZrhDONnubj/cqtV8NegE2/u9Fxx7XoKS/4y5TLY+YJSO+sBDMvutkfq9ijv6vSZ8EJGoXQnite0ynVrm/2kPsV90RY7oWHAA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Azttpu6zgY9wXy9kSRBAV34A4ClI4Dj9iof7q1GboaJigWwC0yZaL65Y478VDXXOY3QvGsW3JFGmigMZ7xVaXNyoKN83Dly0QNrVWihJEWmiLcqdXbr4uYCYRobJuD9y2r3lC0ZTDOrFsQuXbm/OnkI8IDxd6HheI2Hd2t4r3lVStJsxsrA8BB0yYWbterzj+Vjp7oZL5sxitPjbOPT54drs6f206TEEqhAEBYz979f9/W5MM3hLuojDRSgCB20+VrP+nMVGk4O28WCq1sQFCk88DdavOrBep2qFPiOR94PV+lhm6oP/PZbGsvkzVHgog9qSil5yuRw50BL0+Yq5ww==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 06 Apr 2022 15:31:42 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 06.04.2022 17:16, Roger Pau Monne wrote:
> 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_PERF_SHARED_TYPE_ prefix
> for clarity.
> 
> Fixes: 2fa7bee0a0 ('Get ACPI Px from dom0 and choose Px controller')
> Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> ---
> I wonder if we want to keep the CPUFREQ_SHARED_TYPE_ defines for
> internal usage (and define them based on XEN_PERF_SHARED_TYPE_) in
> case we need to pick up changes from Linux.

I think that would be desirable, also to limit code churn by this change.

> --- 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_PERF_SHARED_TYPE_HW   1 /* HW does needed coordination */
> +#define XEN_PERF_SHARED_TYPE_ALL  2 /* All dependent CPUs should set freq */
> +#define XEN_PERF_SHARED_TYPE_ANY  3 /* Freq can be set from any dependent 
> CPU */

While the names may then become a little long, I think it would be
relevant to have "processor" (or maybe "CPU") in the names, to have
a better match with struct xen_processor_performance. Also I'm not
sure you want to define these inside the struct - they're
supposedly suitable for Px, Cx, and Tx aiui (just like the underlying
ACPI constants are).

Jan




 


Rackspace

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