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

RE: [PATCH v3 05/15] xen/x86: introduce "cpufreq=amd-cppc" xen cmdline


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: "Penny, Zheng" <penny.zheng@xxxxxxx>
  • Date: Thu, 27 Mar 2025 03:12:55 +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=8LJM5PtC3Xxr6vped4HW0mD8Ydgluadw/ZZCZTOrU3g=; b=qwFqeojME3EFN70wxbd/8em5V44CaXQ2fcvS0Ugqn+FkjcOjMcazpGQZPTGlt2W3DbsPdaki3Xht8QR/G87y162LHhMZMWe6dG4SnPhKNbNa5FQr1pcyPD8qPgjOHeF3gty417WINwRIx9qMgBTRVTeA7pvK9xxkZ/dL9/PM9WGW8F/+HuSE2lqj5tCo0iOW1fD/Nw0UJfhJmqlXtN21LOflmCvpO0DGXOK594+D1yuJgtsPoELGbzoWjwtqonQ22MSzGBpAMY9wm0doQu0CFKpqZBNcqNsxPpShNITisoivcil2AXwHz/3GG0/W6n20bf6jB2I08alEzUJ9lJTv+w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=UpoxZvwkXbB7vG+r7N6h3+ooeJOorHwTwy3M9mXwzffd4cU5bM3qvcXRJJ+UZf8VZwHSxv399mrvKHUQ8iV0VRa8pxu0gmZ69IF4R/u8kp3Mh9oqj063T9iGcCUk16S8EnjgISmPJXeGRYk1skHY1suwhucNAY8+4rcbquE7MM9riU52Ek58eLUP8Vq12PBVY+1qbWqBvdMMLuPxZAAajG/UXy8A4bMU0Pv0kuSgRV1LUeZ2LQLY8lHQN4suBHxHaFKyTvKz7WKMusWtFxGLd+Y6rlrsw01tVJwiYSuezpZevT0j3XtaWniVY3UE7Xr0QywO7a4gLy1Dr5OurW2UGw==
  • 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>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, "Orzel, Michal" <Michal.Orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 27 Mar 2025 03:13:22 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Msip_labels: MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_ActionId=e32bf465-8cc7-4698-b80d-8819d837cd8a;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-27T03:12:48Z;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: AQHbjnNu8gKP+BdRfUqUIswSBCp7ILOChUeAgAKrd/CAAC16AIABDVww
  • Thread-topic: [PATCH v3 05/15] xen/x86: introduce "cpufreq=amd-cppc" xen cmdline

[Public]

Hi,

> -----Original Message-----
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Sent: Wednesday, March 26, 2025 6:55 PM
> To: Penny, Zheng <penny.zheng@xxxxxxx>
> Cc: Huang, Ray <Ray.Huang@xxxxxxx>; Andrew Cooper
> <andrew.cooper3@xxxxxxxxxx>; Anthony PERARD <anthony.perard@xxxxxxxxxx>;
> Orzel, Michal <Michal.Orzel@xxxxxxx>; Julien Grall <julien@xxxxxxx>; Roger Pau
> Monné <roger.pau@xxxxxxxxxx>; Stefano Stabellini <sstabellini@xxxxxxxxxx>; 
> xen-
> devel@xxxxxxxxxxxxxxxxxxxx
> Subject: Re: [PATCH v3 05/15] xen/x86: introduce "cpufreq=amd-cppc" xen
> cmdline
>
> On 26.03.2025 09:35, Penny, Zheng wrote:
> >> -----Original Message-----
> >> From: Jan Beulich <jbeulich@xxxxxxxx>
> >> Sent: Monday, March 24, 2025 11:26 PM
> >>
> >> On 06.03.2025 09:39, Penny Zheng wrote:
> >>> @@ -514,5 +515,14 @@ acpi_cpufreq_driver = {
> >>>
> >>>  int __init acpi_cpufreq_register(void)  {
> >>> -    return cpufreq_register_driver(&acpi_cpufreq_driver);
> >>> +    int ret;
> >>> +
> >>> +    ret = cpufreq_register_driver(&acpi_cpufreq_driver);
> >>> +    if ( ret )
> >>> +        return ret;
> >>> +
> >>> +    if ( IS_ENABLED(CONFIG_AMD) )
> >>> +        xen_processor_pmbits &= ~XEN_PROCESSOR_PM_CPPC;
> >>
> >> What's the purpose of the if() here?
> >
> > After cpufreq driver properly registered, I'd like XEN_PROCESSOR_PM_PX
> > and XEN_PROCESSOR_PM_CPPC being exclusive value to represent the
> actual underlying registered driver.
> > As users could define something like "cpufreq=amd-cppc,xen", which
> > implies both XEN_PROCESSOR_PM_PX and XEN_PROCESSOR_PM_CPPC
> got set in parsing logic. With amd-cppc failing to register, we are falling 
> back to
> legacy ones. Then XEN_PROCESSOR_PM_CPPC needs to clear.
>
> Looks like you try to explain the &= when my question was about the if().
> I understand the purpose of the &=. What I don't understand is why it needs 
> to be
> conditional.
>

Oh, I got your concern, and I'll remove.

> >>> --- a/xen/include/acpi/cpufreq/cpufreq.h
> >>> +++ b/xen/include/acpi/cpufreq/cpufreq.h
> >>> @@ -28,6 +28,7 @@ enum cpufreq_xen_opt {
> >>>      CPUFREQ_none,
> >>>      CPUFREQ_xen,
> >>>      CPUFREQ_hwp,
> >>> +    CPUFREQ_amd_cppc,
> >>>  };
> >>>  extern enum cpufreq_xen_opt cpufreq_xen_opts[2];
> >>
> >> I'm pretty sure I pointed out before that this array needs to grow,
> >> now that you add a 3rd kind of handling.
> >>
> >
> > Hmmm, but the CPUFREQ_hwp and CPUFREQ_amd_cppc are incompatible
> options.
> > I thought cpufreq_xen_opts[] shall reflect available choices on their 
> > hardware.
> > Even if users define "cpufreq=hwp;amd-cppc;xen", in Intel platform,
> > cpufreq_xen_opts[] shall contain  CPUFREQ_hwp and CPUFREQ_xen, while
> > in amd platform, cpufreq_xen_opts[] shall contain CPUFREQ_amd_cppc and
> > CPUFREQ_xen
>
> Maybe I misread the code, but the impression I got was that "cpufreq=hwp;amd-
> cppc;xen"

My bad. In my platform, I haven't enabled the CONFIG_INTEL. I previously 
assumed that
CONFIG_INTEL and CONFIG_AMD are incompatible options, which leads to the 
following code
```
else if ( IS_ENABLED(CONFIG_INTEL) && choice < 0 &&
          !cmdline_strcmp(str, "hwp") )
{
    xen_processor_pmbits |= XEN_PROCESSOR_PM_PX;
    cpufreq_controller = FREQCTL_xen;
```
shall not be working in AMD platform...
May I ask why not make them incompatible pair? I assumed it each wraps 
vendor-specific feature, like vmx vs svm...

> would populate 3 slots of the array (with one of "hwp" and "amd-cppc" 
> necessarily
> not working, leading to the next one to be tried).
>
> Jan

 


Rackspace

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