aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2017-09-05 08:14:08 -0400
committerLen Brown <len.brown@intel.com>2018-06-01 17:15:08 -0400
commitac980e1357244299f4c929d9f2c45428b35eeb86 (patch)
treef5f6dd36276cb3b5f09e258706a06eaec7d42a28
parent733ef0f8e76e323b5eae36691896fd48ab026056 (diff)
tools/power turbostat: dump BDX, SKX automatic C-state conversion bit
BDX and SKX have a bit that tells them to PROMOTE shallow C-states requests to MWAIT(C6). It is generally a BIOS bug if this bit is set. As we have encountered that BIOS bug, let's print this bit in turbostat debug output. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r--tools/power/x86/turbostat/turbostat.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index af1f81053be9..14530de01e96 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -91,6 +91,7 @@ double rapl_power_units, rapl_time_units;
91double rapl_dram_energy_units, rapl_energy_units; 91double rapl_dram_energy_units, rapl_energy_units;
92double rapl_joule_counter_range; 92double rapl_joule_counter_range;
93unsigned int do_core_perf_limit_reasons; 93unsigned int do_core_perf_limit_reasons;
94unsigned int has_automatic_cstate_conversion;
94unsigned int do_gfx_perf_limit_reasons; 95unsigned int do_gfx_perf_limit_reasons;
95unsigned int do_ring_perf_limit_reasons; 96unsigned int do_ring_perf_limit_reasons;
96unsigned int crystal_hz; 97unsigned int crystal_hz;
@@ -2118,7 +2119,7 @@ dump_nhm_cst_cfg(void)
2118 2119
2119 fprintf(outf, "cpu%d: MSR_PKG_CST_CONFIG_CONTROL: 0x%08llx", base_cpu, msr); 2120 fprintf(outf, "cpu%d: MSR_PKG_CST_CONFIG_CONTROL: 0x%08llx", base_cpu, msr);
2120 2121
2121 fprintf(outf, " (%s%s%s%s%slocked: pkg-cstate-limit=%d: %s)\n", 2122 fprintf(outf, " (%s%s%s%s%slocked: pkg-cstate-limit=%d: %s",
2122 (msr & SNB_C3_AUTO_UNDEMOTE) ? "UNdemote-C3, " : "", 2123 (msr & SNB_C3_AUTO_UNDEMOTE) ? "UNdemote-C3, " : "",
2123 (msr & SNB_C1_AUTO_UNDEMOTE) ? "UNdemote-C1, " : "", 2124 (msr & SNB_C1_AUTO_UNDEMOTE) ? "UNdemote-C1, " : "",
2124 (msr & NHM_C3_AUTO_DEMOTE) ? "demote-C3, " : "", 2125 (msr & NHM_C3_AUTO_DEMOTE) ? "demote-C3, " : "",
@@ -2126,6 +2127,15 @@ dump_nhm_cst_cfg(void)
2126 (msr & (1 << 15)) ? "" : "UN", 2127 (msr & (1 << 15)) ? "" : "UN",
2127 (unsigned int)msr & 0xF, 2128 (unsigned int)msr & 0xF,
2128 pkg_cstate_limit_strings[pkg_cstate_limit]); 2129 pkg_cstate_limit_strings[pkg_cstate_limit]);
2130
2131#define AUTOMATIC_CSTATE_CONVERSION (1UL << 16)
2132 if (has_automatic_cstate_conversion) {
2133 fprintf(outf, ", automatic c-state conversion=%s",
2134 (msr & AUTOMATIC_CSTATE_CONVERSION) ? "on" : "off");
2135 }
2136
2137 fprintf(outf, ")\n");
2138
2129 return; 2139 return;
2130} 2140}
2131 2141
@@ -3632,6 +3642,12 @@ void perf_limit_reasons_probe(unsigned int family, unsigned int model)
3632 } 3642 }
3633} 3643}
3634 3644
3645void automatic_cstate_conversion_probe(unsigned int family, unsigned int model)
3646{
3647 if (is_skx(family, model) || is_bdx(family, model))
3648 has_automatic_cstate_conversion = 1;
3649}
3650
3635int print_thermal(struct thread_data *t, struct core_data *c, struct pkg_data *p) 3651int print_thermal(struct thread_data *t, struct core_data *c, struct pkg_data *p)
3636{ 3652{
3637 unsigned long long msr; 3653 unsigned long long msr;
@@ -4370,6 +4386,7 @@ void process_cpuid()
4370 4386
4371 rapl_probe(family, model); 4387 rapl_probe(family, model);
4372 perf_limit_reasons_probe(family, model); 4388 perf_limit_reasons_probe(family, model);
4389 automatic_cstate_conversion_probe(family, model);
4373 4390
4374 if (!quiet) 4391 if (!quiet)
4375 dump_cstate_pstate_config_info(family, model); 4392 dump_cstate_pstate_config_info(family, model);