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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 9 Sep 2021 16:45:45 -0600
From:   Shuah Khan <skhan@...uxfoundation.org>
To:     Huang Rui <ray.huang@....com>,
        "Rafael J . Wysocki" <rafael.j.wysocki@...el.com>,
        Viresh Kumar <viresh.kumar@...aro.org>,
        Borislav Petkov <bp@...e.de>, Ingo Molnar <mingo@...nel.org>,
        linux-pm@...r.kernel.org
Cc:     Deepak Sharma <deepak.sharma@....com>,
        Alex Deucher <alexander.deucher@....com>,
        Mario Limonciello <mario.limonciello@....com>,
        Nathan Fontenot <nathan.fontenot@....com>,
        Jinzhou Su <Jinzhou.Su@....com>,
        Xiaojian Du <Xiaojian.Du@....com>,
        linux-kernel@...r.kernel.org, x86@...nel.org,
        Shuah Khan <skhan@...uxfoundation.org>
Subject: Re: [PATCH 17/19] cpupower: add amd-pstate get data function to query
 the info

On 9/8/21 8:59 AM, Huang Rui wrote:
> Frequency-info needs an interface to query the current amd-pstate data.
> 

Let's add more information here.
> Signed-off-by: Huang Rui <ray.huang@....com>
> ---
>   tools/power/cpupower/lib/cpufreq.c |  6 ++++++
>   tools/power/cpupower/lib/cpufreq.h | 13 +++++++++++++
>   2 files changed, 19 insertions(+)
> 
> diff --git a/tools/power/cpupower/lib/cpufreq.c b/tools/power/cpupower/lib/cpufreq.c
> index 37da87bdcfb1..1443080868da 100644
> --- a/tools/power/cpupower/lib/cpufreq.c
> +++ b/tools/power/cpupower/lib/cpufreq.c
> @@ -810,3 +810,9 @@ int amd_pstate_boost_enabled(unsigned int cpu)
>   
>   	return cpuinfo_max == amd_pstate_max ? 1 : 0;
>   }
> +
> +unsigned amd_pstate_get_data(unsigned int cpu, enum amd_pstate_param param)
> +{
> +	return sysfs_cpufreq_get_one_value(cpu,
> +					   param + AMD_PSTATE_HIGHEST_PERF);
> +}
> diff --git a/tools/power/cpupower/lib/cpufreq.h b/tools/power/cpupower/lib/cpufreq.h
> index d54d02a7a4f4..954e72704fc0 100644
> --- a/tools/power/cpupower/lib/cpufreq.h
> +++ b/tools/power/cpupower/lib/cpufreq.h
> @@ -206,6 +206,19 @@ int cpufreq_set_frequency(unsigned int cpu,
>   int amd_pstate_boost_support(unsigned int cpu);
>   int amd_pstate_boost_enabled(unsigned int cpu);
>   
> +enum amd_pstate_param {
> +	HIGHEST_PERF,
> +	NOMINAL_PERF,
> +	LOWEST_NONLINEAR_PERF,
> +	LOWEST_PERF,
> +	MAX_FREQ,
> +	NOMINAL_FREQ,
> +	LOWEST_NONLINEAR_FREQ,
> +	MIN_FREQ,
> +};
> +
> +unsigned amd_pstate_get_data(unsigned int cpu, enum amd_pstate_param param);
> +
>   #ifdef __cplusplus
>   }
>   #endif
> 

amd specific things added to common files? I would like to see this patch
series redone to follow the existing common vs. vendor specific separation.

thanks,
-- Shuah


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ