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

RE: [PATCH v4 04/15] xen/cpufreq: refactor cmdline "cpufreq=xxx"


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: "Penny, Zheng" <penny.zheng@xxxxxxx>
  • Date: Wed, 7 May 2025 03:18:35 +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=j4EbJu/FAGSnttB2aaGKs5bKrMdrqPMmiF9bmQQVsJw=; b=hAo1xigFWDzkaZuHgudBtkHAdyW7zB1FecUNTxZOy2xxX1EsUGxIUEiVqFfGYvSJFY4t9rS2SNOc1+qo7uFxpj3WzbLABU2m5Ko9ysnc5oV+n60FNPAPQwRAcC2h96S8EKblNMrOLvjD7Z5jZDgzcYP7S8rDV0WjppXCrOeEqeA4TCulyqLOC3adwPHzyY6sQpuot8r85XDQboDJ3KJW95Of9UkRfVkO11lN2XHac7MQQeegJ4MQWpZSIFyVS/c7Gf/etEReWJL4yRBz3tsWDmTtrobgKFvRYRuaeEIbI9WszWSAYQGezJf/FhM4V7wru2U7MqxeypODVf8MfMSNPg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tiR4K+Pk6mUi4DsPrGf96swfCyJSgFLEK+H0anzJ3j2YgDNto1Xf4L1F1O8Apl8ua26oWWGCSoWmWtHfV4CAhNpi+S2gILBzNVdiyd43/CodEyBkCYzO4X1OEWTTCJZBBre2rOhzyEgktNBikJqBWBKWH1nBPUj5LtZ7yEToTs1Mch6gnXkI+DN2Ilh47ZrhBlAkWoX9vSVRN5nyXgxd3lA8y3dJmz0zDN6gqz5j6+A74sZIqBK+RqgRjPHpF/TwFMEPEiSvmy3mCvFDXxFSPJtvQlNsrlsc4Zk0RD2m2cJ4/XvIP7GIe2yF5Gax2s10Ta8HrJ7ZfVzqLeiu3QvqPQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: "Huang, Ray" <Ray.Huang@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 07 May 2025 03:18:56 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Msip_labels: MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_ActionId=6b72dc6f-99e7-4e0d-865e-c550118b6eb9;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-05-07T03:18:26Z;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: AQHbrRCkbAdH8T2kS0OlR5huTdSxQbO6ixQAgAATnQCADAI+0A==
  • Thread-topic: [PATCH v4 04/15] xen/cpufreq: refactor cmdline "cpufreq=xxx"

[Public]

Hi,

> -----Original Message-----
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Sent: Tuesday, April 29, 2025 7:47 PM
> To: Penny, Zheng <penny.zheng@xxxxxxx>
> Cc: Huang, Ray <Ray.Huang@xxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx
> Subject: Re: [PATCH v4 04/15] xen/cpufreq: refactor cmdline "cpufreq=xxx"
>
> On 29.04.2025 12:36, Jan Beulich wrote:
> > On 14.04.2025 09:40, Penny Zheng wrote:
> >> --- a/xen/drivers/cpufreq/cpufreq.c
> >> +++ b/xen/drivers/cpufreq/cpufreq.c
> >> @@ -71,6 +71,49 @@ unsigned int __initdata cpufreq_xen_cnt = 1;
> >>
> >>  static int __init cpufreq_cmdline_parse(const char *s, const char
> >> *e);
> >>
> >> +static bool __init cpufreq_opts_contain(enum cpufreq_xen_opt option)
> >> +{
> >> +    unsigned int count = cpufreq_xen_cnt;
> >> +
> >> +    while ( count )
> >> +    {
> >> +        if ( cpufreq_xen_opts[--count] == option )
> >> +            return true;
> >> +    }
> >> +
> >> +    return false;
> >> +}
> >> +
> >> +static int __init handle_cpufreq_cmdline(enum cpufreq_xen_opt
> >> +option) {
> >> +    int ret = 0;
> >> +
> >> +    if ( cpufreq_opts_contain(option) )
> >> +    {
> >> +        const char *cpufreq_opts_str[] = { "CPUFREQ_xen",
> >> + "CPUFREQ_hwp" };
> >
> >         const char *const __initconstrel cpufreq_opts_str[] = {
> > "CPUFREQ_xen", "CPUFREQ_hwp" };
> >
> > (line wrapped suitably, of course) Or maybe even better
> >
> >         const char __initconst cpufreq_opts_str[][12] = {
> > "CPUFREQ_xen", "CPUFREQ_hwp" };
> >
> > for the string literals to also end up in .init.rodata.
>
> Actually, it didn't even occur to me that there might be a "static" missing 
> here, too.

Sorry, I may need more explanation, what is the "static" missing you are 
referring?

> Plus I'm missing any arrangement for the array slots to remain in sync with 
> the
> corresponding enumerators. With that ...
>

Thanks for the detailed instructions, learned and I'll change it to
        const char __initconst cpufreq_opts_str[][4] = { "xen", "hwp" };
And for in sync with the corresponding enumerators, maybe we shall add comment 
here,
        /* The order of cpufreq string literal must be in sync with  the order 
in "enum cpufreq_xen_opt" */

> > With all of the adjustments:
> > Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
>
> I'm sorry, but I need to take this back. There are just too many issues.
>
> Jan

 


Rackspace

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