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] [day] [month] [year] [list]
Message-ID: <CAJZ5v0h99RFF26qAnJf07LS0t-6ATm9c2zrQVzdi96x3FAPXQg@mail.gmail.com>
Date: Wed, 30 Apr 2025 16:29:09 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>
Cc: rafael@...nel.org, viresh.kumar@...aro.org, linux-pm@...r.kernel.org, 
	linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH] cpufreq: intel_pstate: Unchecked MSR aceess in legacy mode

On Tue, Apr 29, 2025 at 11:07 PM Srinivas Pandruvada
<srinivas.pandruvada@...ux.intel.com> wrote:
>
> When turbo mode is unavailable on a Skylake-X system, executing the
> command:
> "echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo"
> results in an unchecked MSR access error: WRMSR to 0x199
> (attempted to write 0x0000000100001300).
>
> This issue was reproduced on an OEM (Original Equipment Manufacturer)
> system and is not a common problem across all Skylake-X systems.
>
> This error occurs because the MSR 0x199 Turbo Engage Bit (bit 32) is set
> when turbo mode is disabled. The issue arises when intel_pstate fails to
> detect that turbo mode is disabled. Here intel_pstate relies on
> MSR_IA32_MISC_ENABLE bit 38 to determine the status of turbo mode.
> However, on this system, bit 38 is not set even when turbo mode is
> disabled.
>
> According to the Intel Software Developer's Manual (SDM), the BIOS sets
> this bit during platform initialization to enable or disable
> opportunistic processor performance operations. Logically, this bit
> should be set in such cases. However, the SDM also specifies that "OS and
> applications must use CPUID leaf 06H to detect processors with
> opportunistic processor performance operations enabled."
>
> Therefore, in addition to checking MSR_IA32_MISC_ENABLE bit 38, verify
> that CPUID.06H:EAX[1] is 0 to accurately determine if turbo mode is
> disabled.
>
> Fixes: 4521e1a0ce17 ("cpufreq: intel_pstate: Reflect current no_turbo state correctly")
> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>
> Cc: stable@...r.kernel.org
> ---
>  drivers/cpufreq/intel_pstate.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
> index f41ed0b9e610..ba9bf06f1c77 100644
> --- a/drivers/cpufreq/intel_pstate.c
> +++ b/drivers/cpufreq/intel_pstate.c
> @@ -598,6 +598,9 @@ static bool turbo_is_disabled(void)
>  {
>         u64 misc_en;
>
> +       if (!cpu_feature_enabled(X86_FEATURE_IDA))
> +               return true;
> +
>         rdmsrl(MSR_IA32_MISC_ENABLE, misc_en);
>
>         return !!(misc_en & MSR_IA32_MISC_ENABLE_TURBO_DISABLE);
> --

Applied as a fix for 6.15-rc, thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ