Skip to content

Commit e605f20

Browse files
author
CKI KWF Bot
committed
Merge: cpufreq: intel_pstate: Check IDA only before MSR_IA32_PERF_CTL writes
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/7634 JIRA: https://issues.redhat.com/browse/RHEL-128549 commit 4b747cc Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Date: Mon Nov 10 17:08:40 2025 -0800 cpufreq: intel_pstate: Check IDA only before MSR_IA32_PERF_CTL writes Commit ac4e04d ("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: ac4e04d ("cpufreq: intel_pstate: Unchecked MSR aceess in legacy mode") Reported-by: Aaron Rainbolt <arainbolt@kfocus.org> Closes: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2122531 [1] Tested-by: Aaron Rainbolt <arainbolt@kfocus.org> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@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@intel.com> (cherry picked from commit 4b747cc) Assisted-by: Patchpal Signed-off-by: David Arcari <darcari@redhat.com> Approved-by: Steve Best <sbest@redhat.com> Approved-by: Tony Camuso <tcamuso@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: CKI GitLab Kmaint Pipeline Bot <26919896-cki-kmaint-pipeline-bot@users.noreply.gitlab.com>
2 parents e450153 + de83856 commit e605f20

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/cpufreq/intel_pstate.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -604,9 +604,6 @@ static bool turbo_is_disabled(void)
604604
{
605605
u64 misc_en;
606606

607-
if (!cpu_feature_enabled(X86_FEATURE_IDA))
608-
return true;
609-
610607
rdmsrl(MSR_IA32_MISC_ENABLE, misc_en);
611608

612609
return !!(misc_en & MSR_IA32_MISC_ENABLE_TURBO_DISABLE);
@@ -2151,7 +2148,8 @@ static u64 atom_get_val(struct cpudata *cpudata, int pstate)
21512148
u32 vid;
21522149

21532150
val = (u64)pstate << 8;
2154-
if (READ_ONCE(global.no_turbo) && !READ_ONCE(global.turbo_disabled))
2151+
if (READ_ONCE(global.no_turbo) && !READ_ONCE(global.turbo_disabled) &&
2152+
cpu_feature_enabled(X86_FEATURE_IDA))
21552153
val |= (u64)1 << 32;
21562154

21572155
vid_fp = cpudata->vid.min + mul_fp(
@@ -2316,7 +2314,8 @@ static u64 core_get_val(struct cpudata *cpudata, int pstate)
23162314
u64 val;
23172315

23182316
val = (u64)pstate << 8;
2319-
if (READ_ONCE(global.no_turbo) && !READ_ONCE(global.turbo_disabled))
2317+
if (READ_ONCE(global.no_turbo) && !READ_ONCE(global.turbo_disabled) &&
2318+
cpu_feature_enabled(X86_FEATURE_IDA))
23202319
val |= (u64)1 << 32;
23212320

23222321
return val;

0 commit comments

Comments
 (0)