Skip to contentSkip to conversation

cpufreq: intel_pstate: Check IDA feature only during MSR 0x199 write

PATCH Applied Srinivas Pandruvada 2 participants 2 messages Nov 11, 2025 – Nov 12, 2025

Subsystems (2)
lore
Share & tools
lore

Srinivas Pandruvada

author maintainer
#0 lore raw

PATCH 1/1 cpufreq: intel_pstate: Check IDA feature only during MSR 0x199 write

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, it causes issues on some platforms that disable turbo during OS boot but enable it later. Without this feature check, users were able to write 0 to /sys/devices/system/cpu/intel_pstate/no_turbo post-boot to get turbo mode frequencies.

To restore the old behavior while still addressing the unchecked MSR issue on some Skylake-X systems, limit the X86_FEATURE_IDA check to only when setting MSR 0x199 Turbo Engage Bit (bit 32).

Fixes ac4e04d9e378 ("cpufreq: intel_pstate: Unchecked MSR aceess in legacy mode")
---
 drivers/cpufreq/intel_pstate.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/cpufreq/intel_pstate.c +4 -5
index 38897bb14a2c..492a10f1bdbf 100644
@@ -603,9 +603,6 @@ static bool turbo_is_disabled(void)
 {
 	u64 misc_en;
 
-	if (!cpu_feature_enabled(X86_FEATURE_IDA))
-		return true;
-
 	rdmsrq(MSR_IA32_MISC_ENABLE, misc_en);
 
 	return !!(misc_en & MSR_IA32_MISC_ENABLE_TURBO_DISABLE);
@@ -2106,7 +2103,8 @@ static u64 atom_get_val(struct cpudata *cpudata, int pstate)
 	u32 vid;
 
 	val = (u64)pstate << 8;
-	if (READ_ONCE(global.no_turbo) && !READ_ONCE(global.turbo_disabled))
+	if (READ_ONCE(global.no_turbo) && !READ_ONCE(global.turbo_disabled) &&
+	    cpu_feature_enabled(X86_FEATURE_IDA))
 		val |= (u64)1 << 32;
 
 	vid_fp = cpudata->vid.min + mul_fp(
@@ -2271,7 +2269,8 @@ static u64 core_get_val(struct cpudata *cpudata, int pstate)
 	u64 val;
 
 	val = (u64)pstate << 8;
-	if (READ_ONCE(global.no_turbo) && !READ_ONCE(global.turbo_disabled))
+	if (READ_ONCE(global.no_turbo) && !READ_ONCE(global.turbo_disabled) &&
+	    cpu_feature_enabled(X86_FEATURE_IDA))
 		val |= (u64)1 << 32;
 
 	return val;
Signature · 1 line
2.51.0
maintainer Applied
#1 lore raw
Quoted 47 lines · Srinivas Pandruvada

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, it causes issues on some platforms that disable turbo during OS boot but enable it later. Without this feature check, users were able to write 0 to /sys/devices/system/cpu/intel_pstate/no_turbo post-boot to get turbo mode frequencies.

To restore the old behavior while still addressing the unchecked MSR issue on some Skylake-X systems, limit the X86_FEATURE_IDA check to only when setting MSR 0x199 Turbo Engage Bit (bit 32).

Fixes ac4e04d9e378 ("cpufreq: intel_pstate: Unchecked MSR aceess in legacy mode")
---
 drivers/cpufreq/intel_pstate.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/cpufreq/intel_pstate.c +2 -4
index 38897bb14a2c..492a10f1bdbf 100644
@@ -603,9 +603,6 @@ static bool turbo_is_disabled(void)
 {
        u64 misc_en;
 
-       if (!cpu_feature_enabled(X86_FEATURE_IDA))
-               return true;
-
        rdmsrq(MSR_IA32_MISC_ENABLE, misc_en);
 
        return !!(misc_en & MSR_IA32_MISC_ENABLE_TURBO_DISABLE);
@@ -2106,7 +2103,8 @@ static u64 atom_get_val(struct cpudata *cpudata, int pstate)
        u32 vid;
 
        val = (u64)pstate << 8;
-       if (READ_ONCE(global.no_turbo) && !READ_ONCE(global.turbo_disabled))
+       if (READ_ONCE(global.no_turbo) && !READ_ONCE(global.turbo_disabled) &&
+           cpu_feature_enabled(X86_FEATURE_IDA))
                val |= (u64)1 << 32;
 
        vid_fp = cpudata->vid.min + mul_fp(

drivers/cpufreq/intel_pstate.c static u64 core_get_val(struct cpudata *cpudata, int pstate)

Quoted 10 lines
drivers/cpufreq/intel_pstate.c +2 -2
@@ -2271,7 +2269,8 @@ static u64 core_get_val(struct cpudata *cpudata, int pstate)
        u64 val;
 
        val = (u64)pstate << 8;
-       if (READ_ONCE(global.no_turbo) && !READ_ONCE(global.turbo_disabled))
+       if (READ_ONCE(global.no_turbo) && !READ_ONCE(global.turbo_disabled) &&
+           cpu_feature_enabled(X86_FEATURE_IDA))
                val |= (u64)1 << 32;
 
        return val;
--

Applied as 6.18-rc material, with some adjustments in the subject and changelog.

Thanks!