Skip to content

Commit 3046c99

Browse files
committed
Merge: cpufreq: intel_pstate: Unchecked MSR aceess in legacy mode
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/861 JIRA: https://issues.redhat.com/browse/RHEL-81034 Build Info: 67517444 commit ac4e04d Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Date: Tue Apr 29 14:07:11 2025 -0700 cpufreq: intel_pstate: Unchecked MSR aceess in legacy mode When turbo mode is unavailable on a Skylake-X system, executing the command: 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: 4521e1a ("cpufreq: intel_pstate: Reflect current no_turbo state correctly") Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Cc: All applicable <stable@vger.kernel.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Steve Best <sbest@redhat.com> Approved-by: Tony Camuso <tcamuso@redhat.com> Merged-by: Julio Faracco <jfaracco@redhat.com>
2 parents 3f578e7 + a874130 commit 3046c99

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/cpufreq/intel_pstate.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,9 @@ static bool turbo_is_disabled(void)
598598
{
599599
u64 misc_en;
600600

601+
if (!cpu_feature_enabled(X86_FEATURE_IDA))
602+
return true;
603+
601604
rdmsrl(MSR_IA32_MISC_ENABLE, misc_en);
602605

603606
return !!(misc_en & MSR_IA32_MISC_ENABLE_TURBO_DISABLE);

0 commit comments

Comments
 (0)