intel_pstate: Fix MSR_CONFIG_TDP_x addressing in core_get_max_pstate()
authorJan Kiszka <jan.kiszka@siemens.com>
Fri, 8 Jul 2016 18:42:04 +0000 (20:42 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 Aug 2016 16:10:51 +0000 (18:10 +0200)
commit 5fc8f707a2aa40c767c3a338738b9b6fcd151ac1 upstream.

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.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/cpufreq/intel_pstate.c

index 1fa1a32928d70a30050b30ca2d6eef4aea62d8e3..1b159171f1f9cd7146ab14697d994b9be6804aaa 100644 (file)
@@ -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;