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

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


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Wed, 6 Apr 2022 17:51:16 +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=WKqVM0GBLPqOklK3xiEy2rbpa2st/sNad4YP4pPi1X0=; b=dXKvpiErpMJ9ahQN66mfE7jhr2SOzPDpQFFWs7FhOc5tTgTSZgjGVpb5jWs5DxD+sEr6AvCcX1YLygPA3GgHfnBzwB5fQCXH+G8WAdKVmbmkSReAxYjQmcEj/tS9Wad/UTgqY9bYF63b2xki6RkrRZY1uWo6jj85dC68fMKfIZSnhrnAbwmKfTtL6dmyY7YbPoj0HOrpftKoWgWkaYHe/+RtPB4mrQ7dB3Phn+zsjdWuFds+IQVeorqDlBZ06yn7uMv4X4CUwcIWMh62v1WBPGuArhsYHsUWfC8s3b/KGMrAxIRrUt9XlgnZ7kHW8YBUTFtFEC+6n+UUhaY/M4tpjQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NhB2AatSSJCUtEmIjYTys19jMYwfAexyHeWvQCaR1tJxuBrqvURx8uUyuRYA9DBoVMrLCtwKqqUmszs6sM7pW7puL3m869uOKgDbYbOFir8e/25D2jRdZwP31HfJeLhSnKFkjAr48EURPQobZP3S1HfR+uM9QrGffxtBSc6ezOM7H45wqNZeKcUvOYlXoFKcuYb7pkytQ5bsi7Nu4rRkHroBpN8KFjDTXGr3v2Q/T1JoS1SWNxCCfYGcxEbi26OoOf0cuUzuIQuGsjz9jOiwIKFYHUnuyMI0cSLA4TGmzeB3ofuSVc6zU2OX5cv+ww8OyVp6Q8S/BDilDDWJHRM9/A==
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.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:51:34 +0000
  • Ironport-data: A9a23:jybGNqpw1UA4hru606FnX15Rx2ReBmInZRIvgKrLsJaIsI4StFCzt garIBmPM/+PYWDxftx0bouxoEJUv5eGzYQwTARtqCxjRC1A+JuZCYyVIHmrMnLJJKUvbq7GA +byyDXkBJppJpMJjk71atANlVEliefQAOCU5NfsYkidfyc9IMsaoU8lyrZRbrJA24DjWVvR4 Y2q+aUzBXf+s9JKGjNMg068gEsHUMTa4Fv0aXRnOJinFHeH/5UkJMp3yZOZdhMUcaENdgKOf M7RzanRw4/s10xF5uVJMFrMWhZirrb6ZWBig5fNMkSoqkAqSicais7XOBeAAKv+Zvrgc91Zk b1wWZKMpQgBOvLAxOQ9QkJjPAIiAqMY57n2M3a5vpnGp6HGWyOEL/RGCUg3OcsT+/ptAHEI/ vsdQNwPRknd3aTsmuv9E7QywJR4RCXoFNp3VnVI1zbWAOxgWZnea67L+cVZzHE7gcUm8fP2O ZpANmI0MU6ojxtnFHpPJZFjkuKTonT2fwRU92yo+q4V/D2GpOB2+Oe0a4eEEjCQfu1OhVqRr G/C+2X/AzkZOcaZxD7D9Wij7sffkCW+VI8MGbmQ8v9xnEbV1mEVEAcRV1awvb++kEHWc9BCL 00Z/AI+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wmMW9yUkqp/VWGmLeXLzYO91a9MwQ/U/WuonlrdCsT9Tpc+CQd9k1wg67VBaM0o9 gsCZ4Y5o2mfvVmHp6VO91xNPdfKla9CC4kY1jiaWgOKsk8SgbwQtjMkfII2N0=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, Apr 06, 2022 at 05:31:22PM +0200, Jan Beulich wrote:
> 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).

But those defines are specific to CPUFREQ code, the raw values from
the ACPI tables for the different 'coordination' fields found in the
Cx and Px states use different values, ie:

#define ACPI_DOMAIN_COORD_TYPE_SW_ALL 0xfc
#define ACPI_DOMAIN_COORD_TYPE_SW_ANY 0xfd
#define ACPI_DOMAIN_COORD_TYPE_HW_ALL 0xfe

And hence the values exposed here should be limited to the existing
usage by the xen_processor_performance struct.  Otherwise it would be
preferred to use the native ACPI values, which don't need exposing in
the Xen headers then because are already part of a different
specification. IOW I think it was a mistake for the shared_type field
to use the CPUFREQ defines instead of the ACPI values.

Note the coord_type field in xen_psd_package and xen_processor_csd do
expect the ACPI values instead of the CPUFREQ ones.

Thanks, Roger.



 


Rackspace

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