[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: Fri, 28 Mar 2025 08:27:10 +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=d+sxh/AR3JEoN3w6JEfcd1rT012gUAT3IpQlzHXDyo0=; b=oCBI7yMFbFsd23nOfLoAwz1jHsmHVmQ2F5a5SWPlDlCjfPaRDsDAbDPEpE8rHm5hLjzI9ft47I5yugLcoI76vnkmzGMIDlZbrvkZjB1z2LS331IYTdGUTywaarRLW+X2/YfzJUZ/IPSI3wLgF6i865TWfMPVysvh+Hg2JWPwHIfGsAFLGJp7pIOz1dPzxodT0vOy5+63Q/YgP3BiAvS1ZO/Ituhy8oiCkFZqM/XMG6DWhbRrtuEnFq9MG/70GjwmQaYa9irPDp2+DO5BCV9flGJYTExuf3A6IZCnsRp6E0sLDM3pG34hNxWGPzE5Ir3rXel+6vPDRx+btAZy86Auxw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=oeKgqRDa7qTdZTB2e3C8eeeb0YVlE3Vilv+KOOSJga+nbKXgmCdpL9Iy241B2LCEcj5L5qd92R1rVlEIkg6PjQKYgPiZH9YquFu97UfM1441dmOVOJf1qkYctIEckvRsP1o67fiNJxOhuNGYUl/Swjz3XiDj/Wtn5WwLp8r4hhIc1VO5SYGAL21CBmwxRyIm/i61yIRW4JpOy/SNZEW45+gbt0UBIyJOL2axUtMfMd0D0ta4JiFNmkWhBWUQa/YrYbGCK1s7Ox/zjwsV4kd2bHlnMQ5VM2GkAFM4FvpzUblmZ9RSmAbmEVQBpoFgtc9CxCh8BQKD5kIY6Gd07QIvLQ==
  • 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: Fri, 28 Mar 2025 08:27:24 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Msip_labels: MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_ActionId=e04d8d73-49f7-47a4-89e8-57f62d882f9f;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-28T08:26:37Z;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: AQHbjnNoHifd0xPBh0uO6pYxtSnz1bOCdRiAgADdX2CAAEa1gIAEuShQ
  • 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: Tuesday, March 25, 2025 3:54 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 25.03.2025 05:12, Penny, Zheng wrote:
> >> -----Original Message-----
> >> From: Jan Beulich <jbeulich@xxxxxxxx>
> >> Sent: Monday, March 24, 2025 10:28 PM
> >>
> >> 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.
>
> Yet you realize that this implies Dom0 to know what configuration Xen uses, in
> order to know which data to upload. The best approach might be to have
> Dom0 upload all data it has, with us merely ignoring what we can't make use 
> of.

PLZ correct me if I understand you wrongly:
Right now, I was letting DOM0 upload all data it has, and in the Xen:
```
    case XEN_PM_CPPC:
        if ( !(xen_processor_pmbits & XEN_PROCESSOR_PM_CPPC) )
        {
            ret = -EOPNOTSUPPED;
            break;
        }
        ret = set_cppc_pminfo(op->u.set_pminfo.id,
                              &op->u.set_pminfo.u.cppc_data);
        break;

    case XEN_PM_PX:
        if ( !(xen_processor_pmbits & XEN_PROCESSOR_PM_PX) )
        {
            ret = -EOPNOTSUPPED;
            break;
        }
        ret = set_px_pminfo(op->u.set_pminfo.id, &op->u.set_pminfo.u.perf);
        break;
```
I relied on flag XEN_PROCESSOR_PM_CPPC and XEN_PROCESSOR_PM_PX to choose which
info we shall record.
Firstly, we shall not return -EOPNOTSUPPED error above there.

> The order of uploading (CPPC first or CPPC last) shouldn't matter. Then (and 
> only
> then, and - ftaod - only when uploading of the "wrong" kind of data doesn't 
> result in
> an error) things can go without warning.

Then in
```
    pm_info->init = XEN_CPPC_INIT;
    ret = cpufreq_cpu_init(cpuid);
```
We shall add warning here to clarify no fallback scheme to replace now, when 
ret is not zero.

>
> Jan

 


Rackspace

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