[SRU][N:linux][PATCH 1/1] cpufreq: intel_pstate: Check IDA only before MSR_IA32_PERF_CTL writes
Thibault Ferrante
thibault.ferrante at canonical.com
Tue Jan 13 13:09:35 UTC 2026
From: Srinivas Pandruvada <srinivas.pandruvada at linux.intel.com>
BugLink: https://bugs.launchpad.net/bugs/2122531
Commit ac4e04d9e378 ("cpufreq: intel_pstate: Unchecked MSR aceess in
legacy mode") introduced a check for feature X86_FEATURE_IDA to verify
turbo mode support. Although this is the correct way to check for turbo
mode support, it causes issues on some platforms that disable turbo
during OS boot, but enable it later [1]. Before adding this feature
check, users were able to get turbo mode frequencies by writing 0 to
/sys/devices/system/cpu/intel_pstate/no_turbo post-boot.
To restore the old behavior on the affected systems while still
addressing the unchecked MSR issue on some Skylake-X systems, check
X86_FEATURE_IDA only immediately before updates of MSR_IA32_PERF_CTL
that may involve setting the Turbo Engage Bit (bit 32).
Fixes: ac4e04d9e378 ("cpufreq: intel_pstate: Unchecked MSR aceess in legacy mode")
Reported-by: Aaron Rainbolt <arainbolt at kfocus.org>
Closes: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2122531 [1]
Tested-by: Aaron Rainbolt <arainbolt at kfocus.org>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada at linux.intel.com>
[ rjw: Subject adjustment, changelog edits ]
Link: https://patch.msgid.link/20251111010840.141490-1-srinivas.pandruvada@linux.intel.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki at intel.com>
(backported from commit 4b747cc628d8f500d56cf1338280eacc66362ff3)
[thibf: READ_ONCE on the turbo variable conflicting due to missing 350cbb5d2f,
no impact on this fix]
Signed-off-by: Thibault Ferrante <thibault.ferrante at canonical.com>
---
drivers/cpufreq/intel_pstate.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 599e99a2b9e1d..352bcb40df3b1 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -600,11 +600,6 @@ static inline void update_turbo_state(void)
{
u64 misc_en;
- if (!cpu_feature_enabled(X86_FEATURE_IDA)) {
- global.turbo_disabled = true;
- return;
- }
-
rdmsrl(MSR_IA32_MISC_ENABLE, misc_en);
global.turbo_disabled = misc_en & MSR_IA32_MISC_ENABLE_TURBO_DISABLE;
}
@@ -1813,7 +1808,8 @@ static u64 atom_get_val(struct cpudata *cpudata, int pstate)
u32 vid;
val = (u64)pstate << 8;
- if (global.no_turbo && !global.turbo_disabled)
+ if (global.no_turbo && !global.turbo_disabled &&
+ cpu_feature_enabled(X86_FEATURE_IDA))
val |= (u64)1 << 32;
vid_fp = cpudata->vid.min + mul_fp(
@@ -1978,7 +1974,8 @@ static u64 core_get_val(struct cpudata *cpudata, int pstate)
u64 val;
val = (u64)pstate << 8;
- if (global.no_turbo && !global.turbo_disabled)
+ if (global.no_turbo && !global.turbo_disabled &&
+ cpu_feature_enabled(X86_FEATURE_IDA))
val |= (u64)1 << 32;
return val;
--
2.51.0
More information about the kernel-team
mailing list