Skip to contentSkip to conversation

intel_pstate: Fix MSR_CONFIG_TDP_x addressing in core_get_max_pstate

PATCH In review Jan Kiszka 3 participants 4 messages Jul 8, 2016 – Jul 10, 2016

Subsystems (2)
lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 intel_pstate: Fix MSR_CONFIG_TDP_x addressing in core_get_max_pstate

If MSR_CONFIG_TDP_CONTROL is locked, we currently try to address some MSR 0x80000648 or so. Mask out the relevant level bits 0 and 1.

Found while running over the Jailhouse hypervisor which became upset about this strange MSR index.

---
 drivers/cpufreq/intel_pstate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpufreq/intel_pstate.c +1 -1
index 1fa1a32..1b15917 100644
@@ -944,7 +944,7 @@ static int core_get_max_pstate(void)
 			if (err)
 				goto skip_tar;
 
-			tdp_msr = MSR_CONFIG_TDP_NOMINAL + tdp_ctrl;
+			tdp_msr = MSR_CONFIG_TDP_NOMINAL + (tdp_ctrl & 0x3);
 			err = rdmsrl_safe(tdp_msr, &tdp_ratio);
 			if (err)
 				goto skip_tar;
Signature · 1 line
2.1.4
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Jan Kiszka

If MSR_CONFIG_TDP_CONTROL is locked, we currently try to address some MSR 0x80000648 or so. Mask out the relevant level bits 0 and 1.

Found while running over the Jailhouse hypervisor which became upset about this strange MSR index.

Quoted 19 lines

---
 drivers/cpufreq/intel_pstate.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpufreq/intel_pstate.c +0 -0
index 1fa1a32..1b15917 100644
@@ -944,7 +944,7 @@ static int core_get_max_pstate(void)
  			if (err)
  				goto skip_tar;

drivers/cpufreq/intel_pstate.c +1 -1
-			tdp_msr = MSR_CONFIG_TDP_NOMINAL + tdp_ctrl;
+			tdp_msr = MSR_CONFIG_TDP_NOMINAL + (tdp_ctrl

& 0x3);
  err = rdmsrl_safe(tdp_msr, &tdp_ratio); if (err)
  goto skip_tar;

#2 lore raw
Quoted 9 lines · Srinivas Pandruvada
Quoted 7 lines · Jan Kiszka

If MSR_CONFIG_TDP_CONTROL is locked, we currently try to address some MSR 0x80000648 or so. Mask out the relevant level bits 0 and 1.

Found while running over the Jailhouse hypervisor which became upset about this strange MSR index.

OK

Should this go into stable? Which series if so?

Thanks,
Rafael

#3 lore raw
Quoted 10 lines · Rafael J. Wysocki
Quoted 9 lines · Srinivas Pandruvada
Quoted 8 lines · Jan Kiszka

If MSR_CONFIG_TDP_CONTROL is locked, we currently try to address some
MSR 0x80000648 or so. Mask out the relevant level bits 0 and 1.

Found while running over the Jailhouse hypervisor which became upset
about this strange MSR index.

Quoted 6 lines
Quoted 2 lines
Quoted 1 line

OK

Should this go into stable?

Better to mark for stable tree 4.4+

Thanks,
Srinivas