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: <e0fa24bd-95c4-429f-baa0-537653f8f6e9@gmail.com>
Date: Mon, 28 Oct 2024 22:48:06 +0100
From: Klara Modin <klarasmodin@...il.com>
To: Mario Limonciello <superm1@...nel.org>,
 "Gautham R . Shenoy" <gautham.shenoy@....com>,
 Perry Yuan <perry.yuan@....com>
Cc: Dhananjay Ugwekar <Dhananjay.Ugwekar@....com>,
 "open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)"
 <linux-kernel@...r.kernel.org>,
 "open list:CPU FREQUENCY SCALING FRAMEWORK" <linux-pm@...r.kernel.org>,
 Mario Limonciello <mario.limonciello@....com>
Subject: Re: [PATCH v2 1/2] cpufreq/amd-pstate: Push adjust_perf vfunc init
 into cpu_init

On 2024-10-28 15:55, Mario Limonciello wrote:
> From: Mario Limonciello <mario.limonciello@....com>
> 
> As the driver can be changed in and out of different modes it's possible
> that adjust_perf is assigned when it shouldn't be.
> 
> This could happen if an MSR design is started up in passive mode and then
> switches to active mode.
> 
> To solve this explicitly clear `adjust_perf` in amd_pstate_epp_cpu_init().
> 
> Signed-off-by: Mario Limonciello <mario.limonciello@....com>
> ---
> Cc: Klara Modin <klarasmodin@...il.com>
>   drivers/cpufreq/amd-pstate.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
> index 206725219d8c9..e480da818d6f5 100644
> --- a/drivers/cpufreq/amd-pstate.c
> +++ b/drivers/cpufreq/amd-pstate.c
> @@ -1504,6 +1504,8 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy)
>   		WRITE_ONCE(cpudata->cppc_cap1_cached, value);
>   	}
>   
> +	current_pstate_driver->adjust_perf = NULL;
> +
>   	return 0;
>   
>   free_cpudata1:
> @@ -1866,8 +1868,6 @@ static int __init amd_pstate_init(void)
>   	/* capability check */
>   	if (cpu_feature_enabled(X86_FEATURE_CPPC)) {
>   		pr_debug("AMD CPPC MSR based functionality is supported\n");
> -		if (cppc_state != AMD_PSTATE_ACTIVE)
> -			current_pstate_driver->adjust_perf = amd_pstate_adjust_perf;
>   	} else {
>   		pr_debug("AMD CPPC shared memory based functionality is supported\n");
>   		static_call_update(amd_pstate_cppc_enable, shmem_cppc_enable);

Both of these patches together also fix the problem I had.

Thanks,
Tested-by: Klara Modin <klarasmodin@...il.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ