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

RE: [PATCH v6 10/19] xen/cpufreq: introduce new sub-hypercall to propagate CPPC data


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: "Penny, Zheng" <penny.zheng@xxxxxxx>
  • Date: Mon, 4 Aug 2025 06:47:17 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none
  • 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=2xq/ReXY7puCQUxFZtlcfELrpwip3t48nwXBkwAwcZI=; b=b/5bcFoBfJ9TEAsGXAcCdXuqP8zW+HOHLt7TMSaWU2Y991/zQrKQK1KgM9Slf1QtSksOTeBzPsu9SYTfbi1b2TyIT+o8QDv+BipM1xIgy4Qvej+E/2o7ssCUI+YSskXBmm2U02OiN9/gTXznlbVw/M/qls4EcKITbkTvvyFEPRHXtfX6rMB6cXQm42YLjDi71TH9LVJzh3DBP8nCUJWpOWfT558SHD1eQRemJLRQcSFytmYSFU960uCpO4zcwjATj9l156zK+SETvequavCeQeovoSDuxQd9FPit/3gxrF+UCzTE2TJ7BSzi3QkLjasovImF3NTSEaLcErf5lujXbw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=OlrPvP2pe6iMfaJIdDIKqaUObVxf7U54xvz06cb88cqvKN6/PSIYFs1dl5DNIWC9BrF1Bil1/OTnxjjlAaSLvJrwQuAEHq6WErY5xm7jKV1En6329Qdb/ZNzBvxrz+htZdMCZNRdIHValtpvzHSnv4t09klVtuWaEM0pW5+lNrtNIJa0tZ1ZdQoOLp4mR//iUTPWQtP/UzAmgu0lQoXXHAPKFYsaTnr0HumSpqU8gzNkD30G5x6IitcZvBejB7clHaaWlUpa3z1cdq0qLkytFo7GbdXKaN+6WiUs+BfMcZEZtgE2atYmyHd4EBtPUNV8Rz2CFV0yJKCNVk6katT9UA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: "Huang, Ray" <Ray.Huang@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, "Orzel, Michal" <Michal.Orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 04 Aug 2025 06:47:33 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Msip_labels: MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_Enabled=True;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_SetDate=2025-08-04T06:47:11.0000000Z;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_Name=Open Source;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_ContentBits=3;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_Method=Privileged
  • Thread-index: AQHb8hcitzgUOLdI9E2rorZhWa2gA7Q061mAgB1EZAA=
  • Thread-topic: [PATCH v6 10/19] xen/cpufreq: introduce new sub-hypercall to propagate CPPC data

[Public]

> -----Original Message-----
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Sent: Wednesday, July 16, 2025 11:39 PM
> To: Penny, Zheng <penny.zheng@xxxxxxx>
> Cc: Huang, Ray <Ray.Huang@xxxxxxx>; Andrew Cooper
> <andrew.cooper3@xxxxxxxxxx>; Roger Pau Monné <roger.pau@xxxxxxxxxx>;
> Anthony PERARD <anthony.perard@xxxxxxxxxx>; Orzel, Michal
> <Michal.Orzel@xxxxxxx>; Julien Grall <julien@xxxxxxx>; Stefano Stabellini
> <sstabellini@xxxxxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx
> Subject: Re: [PATCH v6 10/19] xen/cpufreq: introduce new sub-hypercall to
> propagate CPPC data
>
> On 11.07.2025 05:50, Penny Zheng wrote:
> > +             cppc_data->cpc.nominal_perf > cppc_data->cpc.highest_perf )
> > +            /*
> > +             * Right now, Xen doesn't actually use 
> > highest_perf/nominal_perf/
> > +             * lowest_nonlinear_perf/lowest_perf values read from ACPI _CPC
> > +             * table. Xen reads CPPC capability MSR to get these four 
> > values.
> > +             * So warning is enough.
> > +             */
> > +            printk_once(XENLOG_WARNING
> > +                        "Broken CPPC perf values: lowest(%u), 
> > nonlinear_lowest(%u),
> nominal(%u), highest(%u)\n",
> > +                        cppc_data->cpc.lowest_perf,
> > +                        cppc_data->cpc.lowest_nonlinear_perf,
> > +                        cppc_data->cpc.nominal_perf,
> > +                        cppc_data->cpc.highest_perf);
> > +
> > +        /* lowest_mhz and nominal_mhz are optional value */
> > +        if ( cppc_data->cpc.lowest_mhz > cppc_data->cpc.nominal_mhz )
>
> If they're optional, what if lowest_mhz is provided but nominal_mhz isn't?
> Wouldn't the warning needlessly trigger in that case?
>

Yes, only both are provided, this check is meaningful
+        if ( cppc_data->cpc.nominal_mhz &&
+             cppc_data->cpc.lowest_mhz > cppc_data->cpc.nominal_mhz )

> > --- a/xen/include/public/platform.h
> > +++ b/xen/include/public/platform.h
> > @@ -363,6 +363,7 @@ DEFINE_XEN_GUEST_HANDLE(xenpf_getidletime_t);
> >  #define XEN_PM_PX   1
> >  #define XEN_PM_TX   2
> >  #define XEN_PM_PDC  3
> > +#define XEN_PM_CPPC 4
> >
> >  /* Px sub info type */
> >  #define XEN_PX_PCT   1
> > @@ -370,6 +371,10 @@ DEFINE_XEN_GUEST_HANDLE(xenpf_getidletime_t);
> >  #define XEN_PX_PPC   4
> >  #define XEN_PX_PSD   8
> >
> > +/* CPPC sub info type */
> > +#define XEN_CPPC_PSD   1
> > +#define XEN_CPPC_CPC   2
>
> As per this, ...
>
> > @@ -457,6 +462,26 @@ struct xen_processor_performance {  typedef
> > struct xen_processor_performance xen_processor_performance_t;
> > DEFINE_XEN_GUEST_HANDLE(xen_processor_performance_t);
> >
> > +struct xen_processor_cppc {
> > +    uint8_t flags; /* IN: XEN_CPPC_xxx */
>
> ... it's a type that's living here, not a collection of flags. Any reason the 
> field isn't
> named "type"?
>

It is a collection of flags. Only when both XEN_CPPC_PSD and XEN_CPPC_CPC are 
set, we could run cpufreq_cpu_init() to initialize cpufreq core.

> > +    uint8_t pad[3];
> > +    /*
> > +     * IN: Subset _CPC fields useful for CPPC-compatible cpufreq
> > +     * driver's initialization
> > +     */
> > +    struct {
> > +        uint32_t highest_perf;
> > +        uint32_t nominal_perf;
> > +        uint32_t lowest_nonlinear_perf;
> > +        uint32_t lowest_perf;
> > +        uint32_t lowest_mhz;
> > +        uint32_t nominal_mhz;
> > +    } cpc;
>
> What, again, was the reason to wrap these into a sub-struct?

I want to make these fields differentiated from the other two (shared_type and 
domain_info), as sub-struct cpc contains _CPC field info, and the other two 
contains _PSD info

>
> Jan

 


Rackspace

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