aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2015-06-17 16:23:45 -0400
committerLen Brown <len.brown@intel.com>2015-06-17 16:23:45 -0400
commit6fb3143b561c4a7865e5513eeb02d42ef38e8173 (patch)
tree462cbf5abc3b9d07fa4a1cfe1a86a7aa75a20dc9
parentbfae2052265cde825afaba35eb3a4d3889432734 (diff)
tools/power turbostat: dump CONFIG_TDP
Config TDP is a feature that allows parts to be configured for different thermal limits after they have left the factory. This can have an effect on the operation of the part, particularly in determiniing... Max Non-turbo Ratio Turbo Activation Ratio Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r--arch/x86/include/uapi/asm/msr-index.h6
-rw-r--r--tools/power/x86/turbostat/turbostat.c78
2 files changed, 83 insertions, 1 deletions
diff --git a/arch/x86/include/uapi/asm/msr-index.h b/arch/x86/include/uapi/asm/msr-index.h
index 3c6bb342a48f..872b592d86b1 100644
--- a/arch/x86/include/uapi/asm/msr-index.h
+++ b/arch/x86/include/uapi/asm/msr-index.h
@@ -169,6 +169,12 @@
169#define MSR_PP1_ENERGY_STATUS 0x00000641 169#define MSR_PP1_ENERGY_STATUS 0x00000641
170#define MSR_PP1_POLICY 0x00000642 170#define MSR_PP1_POLICY 0x00000642
171 171
172#define MSR_CONFIG_TDP_NOMINAL 0x00000648
173#define MSR_CONFIG_TDP_LEVEL_1 0x00000649
174#define MSR_CONFIG_TDP_LEVEL_2 0x0000064A
175#define MSR_CONFIG_TDP_CONTROL 0x0000064B
176#define MSR_TURBO_ACTIVATION_RATIO 0x0000064C
177
172#define MSR_PKG_WEIGHTED_CORE_C0_RES 0x00000658 178#define MSR_PKG_WEIGHTED_CORE_C0_RES 0x00000658
173#define MSR_PKG_ANY_CORE_C0_RES 0x00000659 179#define MSR_PKG_ANY_CORE_C0_RES 0x00000659
174#define MSR_PKG_ANY_GFXE_C0_RES 0x0000065A 180#define MSR_PKG_ANY_GFXE_C0_RES 0x0000065A
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index 67162ec6e87b..5a793bed453a 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -1384,6 +1384,49 @@ dump_nhm_cst_cfg(void)
1384 return; 1384 return;
1385} 1385}
1386 1386
1387static void
1388dump_config_tdp(void)
1389{
1390 unsigned long long msr;
1391
1392 get_msr(base_cpu, MSR_CONFIG_TDP_NOMINAL, &msr);
1393 fprintf(stderr, "cpu%d: MSR_CONFIG_TDP_NOMINAL: 0x%08llx", base_cpu, msr);
1394 fprintf(stderr, " (base_ratio=%d)\n", (unsigned int)msr & 0xEF);
1395
1396 get_msr(base_cpu, MSR_CONFIG_TDP_LEVEL_1, &msr);
1397 fprintf(stderr, "cpu%d: MSR_CONFIG_TDP_LEVEL_1: 0x%08llx (", base_cpu, msr);
1398 if (msr) {
1399 fprintf(stderr, "PKG_MIN_PWR_LVL1=%d ", (unsigned int)(msr >> 48) & 0xEFFF);
1400 fprintf(stderr, "PKG_MAX_PWR_LVL1=%d ", (unsigned int)(msr >> 32) & 0xEFFF);
1401 fprintf(stderr, "LVL1_RATIO=%d ", (unsigned int)(msr >> 16) & 0xEF);
1402 fprintf(stderr, "PKG_TDP_LVL1=%d", (unsigned int)(msr) & 0xEFFF);
1403 }
1404 fprintf(stderr, ")\n");
1405
1406 get_msr(base_cpu, MSR_CONFIG_TDP_LEVEL_2, &msr);
1407 fprintf(stderr, "cpu%d: MSR_CONFIG_TDP_LEVEL_2: 0x%08llx (", base_cpu, msr);
1408 if (msr) {
1409 fprintf(stderr, "PKG_MIN_PWR_LVL2=%d ", (unsigned int)(msr >> 48) & 0xEFFF);
1410 fprintf(stderr, "PKG_MAX_PWR_LVL2=%d ", (unsigned int)(msr >> 32) & 0xEFFF);
1411 fprintf(stderr, "LVL2_RATIO=%d ", (unsigned int)(msr >> 16) & 0xEF);
1412 fprintf(stderr, "PKG_TDP_LVL2=%d", (unsigned int)(msr) & 0xEFFF);
1413 }
1414 fprintf(stderr, ")\n");
1415
1416 get_msr(base_cpu, MSR_CONFIG_TDP_CONTROL, &msr);
1417 fprintf(stderr, "cpu%d: MSR_CONFIG_TDP_CONTROL: 0x%08llx (", base_cpu, msr);
1418 if ((msr) & 0x3)
1419 fprintf(stderr, "TDP_LEVEL=%d ", (unsigned int)(msr) & 0x3);
1420 fprintf(stderr, " lock=%d", (unsigned int)(msr >> 31) & 1);
1421 fprintf(stderr, ")\n");
1422
1423 get_msr(base_cpu, MSR_TURBO_ACTIVATION_RATIO, &msr);
1424 fprintf(stderr, "cpu%d: MSR_TURBO_ACTIVATION_RATIO: 0x%08llx (", base_cpu, msr);
1425 fprintf(stderr, "MAX_NON_TURBO_RATIO=%d", (unsigned int)(msr) & 0xEF);
1426 fprintf(stderr, " lock=%d", (unsigned int)(msr >> 31) & 1);
1427 fprintf(stderr, ")\n");
1428}
1429
1387void free_all_buffers(void) 1430void free_all_buffers(void)
1388{ 1431{
1389 CPU_FREE(cpu_present_set); 1432 CPU_FREE(cpu_present_set);
@@ -1873,6 +1916,36 @@ int has_knl_turbo_ratio_limit(unsigned int family, unsigned int model)
1873 return 0; 1916 return 0;
1874 } 1917 }
1875} 1918}
1919int has_config_tdp(unsigned int family, unsigned int model)
1920{
1921 if (!genuine_intel)
1922 return 0;
1923
1924 if (family != 6)
1925 return 0;
1926
1927 switch (model) {
1928 case 0x3A: /* IVB */
1929 case 0x3E: /* IVB Xeon */
1930
1931 case 0x3C: /* HSW */
1932 case 0x3F: /* HSX */
1933 case 0x45: /* HSW */
1934 case 0x46: /* HSW */
1935 case 0x3D: /* BDW */
1936 case 0x47: /* BDW */
1937 case 0x4F: /* BDX */
1938 case 0x56: /* BDX-DE */
1939 case 0x4E: /* SKL */
1940 case 0x5E: /* SKL */
1941
1942 case 0x57: /* Knights Landing */
1943 return 1;
1944 default:
1945 return 0;
1946 }
1947}
1948
1876static void 1949static void
1877dump_cstate_pstate_config_info(family, model) 1950dump_cstate_pstate_config_info(family, model)
1878{ 1951{
@@ -1893,6 +1966,9 @@ dump_cstate_pstate_config_info(family, model)
1893 if (has_knl_turbo_ratio_limit(family, model)) 1966 if (has_knl_turbo_ratio_limit(family, model))
1894 dump_knl_turbo_ratio_limits(); 1967 dump_knl_turbo_ratio_limits();
1895 1968
1969 if (has_config_tdp(family, model))
1970 dump_config_tdp();
1971
1896 dump_nhm_cst_cfg(); 1972 dump_nhm_cst_cfg();
1897} 1973}
1898 1974
@@ -3014,7 +3090,7 @@ int get_and_dump_counters(void)
3014} 3090}
3015 3091
3016void print_version() { 3092void print_version() {
3017 fprintf(stderr, "turbostat version 4.7 27-May, 2015" 3093 fprintf(stderr, "turbostat version 4.7 17-June, 2015"
3018 " - Len Brown <lenb@kernel.org>\n"); 3094 " - Len Brown <lenb@kernel.org>\n");
3019} 3095}
3020 3096