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]
Message-ID: <20210916092918.GC3755511@hr-amd>
Date:   Thu, 16 Sep 2021 17:29:18 +0800
From:   Huang Rui <ray.huang@....com>
To:     Shuah Khan <skhan@...uxfoundation.org>
CC:     "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" <linux-pm@...r.kernel.org>,
        "Sharma, Deepak" <Deepak.Sharma@....com>,
        "Deucher, Alexander" <Alexander.Deucher@....com>,
        "Limonciello, Mario" <Mario.Limonciello@....com>,
        "Fontenot, Nathan" <Nathan.Fontenot@....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 18/19] cpupower: print amd-pstate information on cpupower

On Fri, Sep 10, 2021 at 06:46:39AM +0800, Shuah Khan wrote:
> On 9/8/21 9:00 AM, Huang Rui wrote:
> > amd-pstate kernel module is using the fine grain frequency instead of
> > acpi hardware pstate. So the performance and frequency values should be
> > printed in frequency-info.
> > 
> > Signed-off-by: Huang Rui <ray.huang@....com>
> > ---
> >   tools/power/cpupower/utils/cpufreq-info.c | 27 ++++++++++++++++++++---
> >   1 file changed, 24 insertions(+), 3 deletions(-)
> > 
> > diff --git a/tools/power/cpupower/utils/cpufreq-info.c b/tools/power/cpupower/utils/cpufreq-info.c
> > index f9895e31ff5a..9eabed209adc 100644
> > --- a/tools/power/cpupower/utils/cpufreq-info.c
> > +++ b/tools/power/cpupower/utils/cpufreq-info.c
> > @@ -183,9 +183,30 @@ static int get_boost_mode_x86(unsigned int cpu)
> >   	printf(_("    Supported: %s\n"), support ? _("yes") : _("no"));
> >   	printf(_("    Active: %s\n"), active ? _("yes") : _("no"));
> >   
> > -	if ((cpupower_cpu_info.vendor == X86_VENDOR_AMD &&
> > -	     cpupower_cpu_info.family >= 0x10) ||
> > -	     cpupower_cpu_info.vendor == X86_VENDOR_HYGON) {
> > +	if (cpupower_cpu_info.vendor == X86_VENDOR_AMD &&
> > +	    cpupower_cpu_info.caps & CPUPOWER_CAP_AMD_PSTATE) {
> > +		printf(_("    AMD PSTATE Highest Performance: %u. Maximum Frequency: "),
> > +		       amd_pstate_get_data(cpu, HIGHEST_PERF));
> > +		print_speed(amd_pstate_get_data(cpu, MAX_FREQ));
> > +		printf(".\n");
> > +
> > +		printf(_("    AMD PSTATE Nominal Performance: %u. Nominal Frequency: "),
> > +		       amd_pstate_get_data(cpu, NOMINAL_PERF));
> > +		print_speed(amd_pstate_get_data(cpu, NOMINAL_FREQ));
> > +		printf(".\n");
> > +
> > +		printf(_("    AMD PSTATE Lowest Non-linear Performance: %u. Lowest Non-linear Frequency: "),
> > +		       amd_pstate_get_data(cpu, LOWEST_NONLINEAR_PERF));
> > +		print_speed(amd_pstate_get_data(cpu, LOWEST_NONLINEAR_FREQ));
> > +		printf(".\n");
> > +
> > +		printf(_("    AMD PSTATE Lowest Performance: %u. Lowest Frequency: "),
> > +		       amd_pstate_get_data(cpu, LOWEST_PERF));
> > +		print_speed(amd_pstate_get_data(cpu, MIN_FREQ));
> > +		printf(".\n");
> > +	} else if ((cpupower_cpu_info.vendor == X86_VENDOR_AMD &&
> > +		    cpupower_cpu_info.family >= 0x10) ||
> > +		   cpupower_cpu_info.vendor == X86_VENDOR_HYGON) {
> >   		ret = decode_pstates(cpu, b_states, pstates, &pstate_no);
> >   		if (ret)
> >   			return ret;
> > 
> 
> Same issue here - amd specific code sprinkled all over the common routines.
> Needs fixing.

I will make a funciton in utils/helpers/amd.c to prints amd_pstate status.

Thanks,
Ray

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ