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

RE: [PATCH v3 02/15] xen/x86: introduce new sub-hypercall to propagate CPPC data


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: "Penny, Zheng" <penny.zheng@xxxxxxx>
  • Date: Tue, 25 Mar 2025 04:12:43 +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=pS9Eecvai0patCO1u5P34W5vISWfUZJbOeqFwydXJG0=; b=AxH5LjzO3bA/SDLJr6fhvcWI8wQdXD9GtbSvLX3V8HWWKcKpq42ZUUDkx5lFtuEGdNYqPukVV0Ayb/46j+WYm1RXpG9lPoJKT4aPHYkx+fOHEmFPEp0EFQaXo4u49IXaFLlrxOZDYTThcXGTA2NzuEOlNZFyJLHRBweQTfRyaOje28BgaWGfBFw98cgXbVXuPg9OQCheWSxkyFiu+hhbWqnNtUI5jQliJVLK622tl5r19GgEL2yGOFoq2xGLsJfC4egnIeYPz2fPdAc/gOHD63apq4HKVIA8++5/2gGAFRacug0TI5N2XT8nOChoTnETx03ZVddj6zNfwwSiHvP+6w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=kFC1iwh+mqC0N1XTsz4ybmnaCQrWbRCB2EMJIenIegubiuKYs3Ph9/UoXSBJBxoCiXwQE1rVgaJ4LsO1nIM1FfpB0y/SSKBfyXRK4lhg4fJ/zcjBMr+fEOhW9q9l8kXgHQ33lmLbH95a+hVVYGbQx9U0Ri8JhQbEpFcuSvQmzk9CmxLeJH405T0ZVey3/GjMDmf2W9TDOQ+mfN1OcQbCw9v8RLdrLkpkar0tsFkWIk+uyv/3AI/VwpKKmlJIrF7F8SsWz4Li03SGj96LiNnC9TeK8Q++GpyZ2RRtjaDvo4rd3liTSNNu/cALqlrspTgKeErOzQM93vlBeojSg0by+A==
  • 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: Tue, 25 Mar 2025 04:13:12 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Msip_labels: MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_ActionId=5e067145-076b-4c82-bced-00d63b9ba6bf;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_ContentBits=0;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_Enabled=true;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_Method=Privileged;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_Name=Open Source;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_SetDate=2025-03-25T04:12:35Z;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_Tag=10, 0, 1, 1;
  • Thread-index: AQHbjnNoHifd0xPBh0uO6pYxtSnz1bOCdRiAgADdX2A=
  • Thread-topic: [PATCH v3 02/15] xen/x86: introduce new sub-hypercall to propagate CPPC data

[Public]

Hi,

> -----Original Message-----
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Sent: Monday, March 24, 2025 10:28 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 v3 02/15] xen/x86: introduce new sub-hypercall to 
> propagate
> CPPC data
>
> On 06.03.2025 09:39, Penny Zheng wrote:
> > +    pm_info = processor_pminfo[cpuid];
> > +    /* Must already allocated in set_psd_pminfo */
> > +    if ( !pm_info )
> > +    {
> > +        ret = -EINVAL;
> > +        goto out;
> > +    }
> > +    pm_info->cppc_data = *cppc_data;
> > +
> > +    if ( cpufreq_verbose )
> > +        print_CPPC(&pm_info->cppc_data);
> > +
> > +    pm_info->init = XEN_CPPC_INIT;
>
> That is - whichever Dom0 invoked last will have data recorded, and the other
> effectively is discarded? I think a warning (perhaps a one-time one) is 
> minimally
> needed to diagnose the case where one type of data replaces the other.
>

In last v2 discussion, we are discussing that either set_px_pminfo or 
set_cppc_pminfo shall be invoked,
which means either PX data is recorded, or CPPC data is recorded.
Current logic is that, cpufreq cmdline logic will set the 
XEN_PROCESSOR_PM_PX/CPPC
flag to reflect user preference, if user defines the fallback option, like 
"cpufreq=amd-cppc,xen", we will have both
 XEN_PROCESSOR_PM_PX | XEN_PROCESSOR_PM_CPPC set in the beginning.
Later in cpufreq driver register logic, as only one register could be 
registered , if amd-cppc
being registered successfully, it will clear the  XEN_PROCESSOR_PM_PX flag bit.
But if it fails to register, fallback scheme kicks off, we will try the legacy 
P-states, in the mean time,
clearing the XEN_PROCESSOR_PM_CPPC.
We are trying to make XEN_PROCESSOR_PM_PX and XEN_PROCESSOR_PM_CPPC exclusive
values after driver registration, which will ensure us that either 
set_px_pminfo or set_cppc_pminfo
is taken in the runtime.

> With this it also remains unclear to me how fallback to the legacy driver is 
> intended
> to be working. Both taken together are a strong suggestion that important
> information on the model that is being implemented is missing from the 
> description.
>
> > @@ -27,8 +28,6 @@ struct processor_performance {
> >      struct xen_pct_register status_register;
> >      uint32_t state_count;
> >      struct xen_processor_px *states;
> > -
> > -    uint32_t init;
> >  };
> >
> >  struct processor_pminfo {
> > @@ -37,6 +36,9 @@ struct processor_pminfo {
> >      struct xen_psd_package domain_info;
> >      uint32_t shared_type;
> >      struct processor_performance    perf;
> > +    struct xen_processor_cppc cppc_data;
> > +
> > +    uint32_t init;
> >  };
>
> This moving of the "init" field and the mechanical changes coming with it can 
> likely
> be split out to a separate patch? Provided of course the movement is still
> wanted/needed with patch 1 re-worked or dropped.
>
> Jan

 


Rackspace

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