[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 Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 6 Apr 2022 17:54:19 +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=j4u3NPZpEajzisC3g0rVxRAkrG+CWew5OjjzP3q1X1g=; b=X1LTo2G8lUYAjSHWjVLboXkuV4IpknA8whESp/CT7DJyg8zQoFkp+dhs0jm9r8HgasZ8NAl+cX+Ws1znnnjcSqpWm6oBClYskphn6H5Xw6hGxgfbHXw3+YzVYAieID3RUY1SGz6g3bQ1bqedxkTzfpqTx5CNOrTPEtI7rY+cxgM734CceKId+6xFP8r5TaIwzuJ3IUEw7YooXIY1VYOB0y+MxBJfHvCLbmk+RzL0hFvoZnPyENLflmGV+O1Qm2tzw/p+9crQQ7Zzm/PD80cILlqj/0c8lwRNrpO745deccjSvKPmUJpsLQUvoaV3khjKjVlxdJkrLijpo9F/Z2D/bw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k4z1ob4J6ZmDBycUscHH2CCnFR0r1KUGTWS5Qb270VGhOIiTIqmoA5GuyshN6r5hyO5EQ9xmOMpd4K0jYQbHdoOcm1igqvxJ8Gsowm+iKVMxv30PjgfE0Y1C3V3PBNG33GvsMKgsWOVqmnFupjdz9KcjWVhPc9ck3DLwI7oviKdlkhIWU/KpPCRW88LmIOg1F5QYKvw898wUKSrMZ1hx1eBbgJshKuf+cvDrZ+KsMFf8B36k9gCfdaJCK8RcZ32ZESw4PfYoP0btMdqCXyR5RrmpimWdqsyHP3oaFt5WZEx+wEj8w+8ziuNBHdhzmWQf8v+/trYdgSlmhrNkvjxDOw==
  • 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:54:33 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 06.04.2022 17:51, Roger Pau Monné wrote:
> 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.

Oh, yes, sorry.

>  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.

I agree, but we can't do anything about this now.

Jan




 


Rackspace

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