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: <20210913125823.GF3731830@hr-amd>
Date:   Mon, 13 Sep 2021 20:58:23 +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 14/19] cpupower: initial AMD P-state capability

On Fri, Sep 10, 2021 at 06:16:50AM +0800, Shuah Khan wrote:
> On 9/8/21 8:59 AM, Huang Rui wrote:
> > If kernel enables AMD P-state, cpupower won't need to respond ACPI
> > hardware P-states function anymore.
> > 
> 
> This commit log doesn't seem to match the code change. I see it
> calling cpupower_amd_pstate_enabled() and setting flags.

Hmm, yes, I should reword this as well. If the kernel uses the amd-pstate
module, we only need CPUPOWER_CAP_AMD_PSTATE flag, and disable the legacy
acpi-cpufreq relative flags.

> 
> > Signed-off-by: Huang Rui <ray.huang@....com>
> > ---
> >   tools/power/cpupower/utils/helpers/cpuid.c | 13 +++++++++++++
> >   1 file changed, 13 insertions(+)
> > 
> > diff --git a/tools/power/cpupower/utils/helpers/cpuid.c b/tools/power/cpupower/utils/helpers/cpuid.c
> > index 72eb43593180..78218c54acca 100644
> > --- a/tools/power/cpupower/utils/helpers/cpuid.c
> > +++ b/tools/power/cpupower/utils/helpers/cpuid.c
> > @@ -149,6 +149,19 @@ int get_cpu_info(struct cpupower_cpu_info *cpu_info)
> >   		if (ext_cpuid_level >= 0x80000008 &&
> >   		    cpuid_ebx(0x80000008) & (1 << 4))
> >   			cpu_info->caps |= CPUPOWER_CAP_AMD_RDPRU;
> > +
> > +		if (cpupower_amd_pstate_enabled(0)) {
> 
> What is the reason for calling this function with cpu id = 0?

No specific reason, actually, any cpu id should be ok here.

Thanks,
Ray

> 
> 
> > +			cpu_info->caps |= CPUPOWER_CAP_AMD_PSTATE;
> > +
> > +			/*
> > +			 * If AMD P-state is enabled, the firmware will treat
> > +			 * AMD P-state function as high priority.
> > +			 */
> > +			cpu_info->caps &= ~CPUPOWER_CAP_AMD_CPB;
> > +			cpu_info->caps &= ~CPUPOWER_CAP_AMD_CPB_MSR;
> > +			cpu_info->caps &= ~CPUPOWER_CAP_AMD_HW_PSTATE;
> > +			cpu_info->caps &= ~CPUPOWER_CAP_AMD_PSTATEDEF;
> > +		}
> >   	}
> >   
> >   	if (cpu_info->vendor == X86_VENDOR_INTEL) {
> > 
> 
> thanks,
> -- Shuah

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ