Skip to content

Commit 03c8398

Browse files
spandruvadarafaeljw
authored andcommitted
cpufreq: intel_pstate: ITMT support for overclocked system
On systems with overclocking enabled, CPPC Highest Performance can be hard coded to 0xff. In this case even if we have cores with different highest performance, ITMT can't be enabled as the current implementation depends on CPPC Highest Performance. On such systems we can use MSR_HWP_CAPABILITIES maximum performance field when CPPC.Highest Performance is 0xff. Due to legacy reasons, we can't solely depend on MSR_HWP_CAPABILITIES as in some older systems CPPC Highest Performance is the only way to identify different performing cores. Reported-by: Michael Larabel <[email protected]> Signed-off-by: Srinivas Pandruvada <[email protected]> Tested-by: Michael Larabel <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent ed38eb4 commit 03c8398

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/cpufreq/intel_pstate.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,8 @@ static void intel_pstste_sched_itmt_work_fn(struct work_struct *work)
338338

339339
static DECLARE_WORK(sched_itmt_work, intel_pstste_sched_itmt_work_fn);
340340

341+
#define CPPC_MAX_PERF U8_MAX
342+
341343
static void intel_pstate_set_itmt_prio(int cpu)
342344
{
343345
struct cppc_perf_caps cppc_perf;
@@ -348,6 +350,14 @@ static void intel_pstate_set_itmt_prio(int cpu)
348350
if (ret)
349351
return;
350352

353+
/*
354+
* On some systems with overclocking enabled, CPPC.highest_perf is hardcoded to 0xff.
355+
* In this case we can't use CPPC.highest_perf to enable ITMT.
356+
* In this case we can look at MSR_HWP_CAPABILITIES bits [8:0] to decide.
357+
*/
358+
if (cppc_perf.highest_perf == CPPC_MAX_PERF)
359+
cppc_perf.highest_perf = HWP_HIGHEST_PERF(READ_ONCE(all_cpu_data[cpu]->hwp_cap_cached));
360+
351361
/*
352362
* The priorities can be set regardless of whether or not
353363
* sched_set_itmt_support(true) has been called and it is valid to

0 commit comments

Comments
 (0)