lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 10 Nov 2021 20:28:06 +0800
From:   Huang Rui <ray.huang@....com>
To:     "Fontenot, Nathan" <Nathan.Fontenot@....com>
Cc:     "Rafael J . Wysocki" <rafael.j.wysocki@...el.com>,
        Viresh Kumar <viresh.kumar@...aro.org>,
        Shuah Khan <skhan@...uxfoundation.org>,
        Borislav Petkov <bp@...e.de>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...nel.org>,
        Giovanni Gherdovich <ggherdovich@...e.cz>,
        "linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
        "Sharma, Deepak" <Deepak.Sharma@....com>,
        "Deucher, Alexander" <Alexander.Deucher@....com>,
        "Limonciello, Mario" <Mario.Limonciello@....com>,
        Steven Noonan <steven@...vesoftware.com>,
        "Su, Jinzhou (Joe)" <Jinzhou.Su@....com>,
        "Du, Xiaojian" <Xiaojian.Du@....com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "x86@...nel.org" <x86@...nel.org>
Subject: Re: [PATCH v3 11/21] cpufreq: amd: add amd-pstate frequencies
 attributes

On Sat, Nov 06, 2021 at 02:59:55AM +0800, Fontenot, Nathan wrote:
> On 10/29/21 8:02 AM, Huang Rui wrote:
> > Introduce sysfs attributes to get the different level processor
> > frequencies.
> > 
> > Signed-off-by: Huang Rui <ray.huang@....com>
> > ---
> >  drivers/cpufreq/amd-pstate.c | 63 ++++++++++++++++++++++++++++++++++++
> >  1 file changed, 63 insertions(+)
> > 
> > diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
> > index 9af27ac1f818..8cf1e80f44e0 100644
> > --- a/drivers/cpufreq/amd-pstate.c
> > +++ b/drivers/cpufreq/amd-pstate.c
> > @@ -485,6 +485,68 @@ static int amd_pstate_cpu_exit(struct cpufreq_policy *policy)
> >  	return 0;
> >  }
> >  
> > +/* Sysfs attributes */
> > +
> > +/* This frequency is to indicate the maximum hardware frequency.
> > + * If boost is not active but supported, the frequency will be larger than the
> > + * one in cpuinfo.
> > + */
> > +static ssize_t show_amd_pstate_max_freq(struct cpufreq_policy *policy,
> > +					char *buf)
> > +{
> > +	int max_freq;
> > +	struct amd_cpudata *cpudata;
> > +
> > +	cpudata = policy->driver_data;
> > +
> > +	max_freq = amd_get_max_freq(cpudata);
> > +	if (max_freq < 0)
> > +		return max_freq;
> > +
> > +	return sprintf(&buf[0], "%u\n", max_freq);
> > +}
> > +
> > +static ssize_t show_amd_pstate_nominal_freq(struct cpufreq_policy *policy,
> > +					    char *buf)
> > +{
> > +	int nominal_freq;
> > +	struct amd_cpudata *cpudata;
> > +
> > +	cpudata = policy->driver_data;
> > +
> > +	nominal_freq = amd_get_nominal_freq(cpudata);
> > +	if (nominal_freq < 0)
> > +		return nominal_freq;
> > +
> > +	return sprintf(&buf[0], "%u\n", nominal_freq);
> > +}
> 
> The nominal_freq valus is already reported in sysfs by drivers/acpi since this
> value is part of the ACPI spec. Is there a reason to have multiple sysfs entries 
> for the same value?
> 

I will clean them up in V4. Thanks!

Ray

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ