Lines Matching refs:msr
279 int get_msr_sum(int cpu, off_t offset, unsigned long long *msr);
497 int get_msr(int cpu, off_t offset, unsigned long long *msr) in get_msr() argument
501 retval = pread(get_msr_fd(cpu), msr, sizeof(*msr), offset); in get_msr()
503 if (retval != sizeof *msr) in get_msr()
1895 unsigned long long msr; in get_counters() local
1972 if (get_msr(cpu, MSR_SMI_COUNT, &msr)) in get_counters()
1974 t->smi_count = msr & 0xFFFFFFFF; in get_counters()
2012 if (get_msr(cpu, MSR_IA32_THERM_STATUS, &msr)) in get_counters()
2014 c->core_temp_c = tcc_activation_temp - ((msr >> 16) & 0x7F); in get_counters()
2018 if (get_msr(cpu, MSR_CORE_ENERGY_STAT, &msr)) in get_counters()
2020 c->core_energy = msr & 0xFFFFFFFF; in get_counters()
2083 if (get_msr_sum(cpu, MSR_PKG_ENERGY_STATUS, &msr)) in get_counters()
2085 p->energy_pkg = msr; in get_counters()
2088 if (get_msr_sum(cpu, MSR_PP0_ENERGY_STATUS, &msr)) in get_counters()
2090 p->energy_cores = msr; in get_counters()
2093 if (get_msr_sum(cpu, MSR_DRAM_ENERGY_STATUS, &msr)) in get_counters()
2095 p->energy_dram = msr; in get_counters()
2098 if (get_msr_sum(cpu, MSR_PP1_ENERGY_STATUS, &msr)) in get_counters()
2100 p->energy_gfx = msr; in get_counters()
2103 if (get_msr_sum(cpu, MSR_PKG_PERF_STATUS, &msr)) in get_counters()
2105 p->rapl_pkg_perf_status = msr; in get_counters()
2108 if (get_msr_sum(cpu, MSR_DRAM_PERF_STATUS, &msr)) in get_counters()
2110 p->rapl_dram_perf_status = msr; in get_counters()
2113 if (get_msr_sum(cpu, MSR_PKG_ENERGY_STAT, &msr)) in get_counters()
2115 p->energy_pkg = msr; in get_counters()
2118 if (get_msr(cpu, MSR_IA32_PACKAGE_THERM_STATUS, &msr)) in get_counters()
2120 p->pkg_temp_c = tcc_activation_temp - ((msr >> 16) & 0x7F); in get_counters()
2188 unsigned long long msr; in dump_nhm_platform_info() local
2191 get_msr(base_cpu, MSR_PLATFORM_INFO, &msr); in dump_nhm_platform_info()
2193 fprintf(outf, "cpu%d: MSR_PLATFORM_INFO: 0x%08llx\n", base_cpu, msr); in dump_nhm_platform_info()
2195 ratio = (msr >> 40) & 0xFF; in dump_nhm_platform_info()
2199 ratio = (msr >> 8) & 0xFF; in dump_nhm_platform_info()
2203 get_msr(base_cpu, MSR_IA32_POWER_CTL, &msr); in dump_nhm_platform_info()
2205 base_cpu, msr, msr & 0x2 ? "EN" : "DIS"); in dump_nhm_platform_info()
2213 unsigned long long msr; in dump_hsw_turbo_ratio_limits() local
2216 get_msr(base_cpu, MSR_TURBO_RATIO_LIMIT2, &msr); in dump_hsw_turbo_ratio_limits()
2218 fprintf(outf, "cpu%d: MSR_TURBO_RATIO_LIMIT2: 0x%08llx\n", base_cpu, msr); in dump_hsw_turbo_ratio_limits()
2220 ratio = (msr >> 8) & 0xFF; in dump_hsw_turbo_ratio_limits()
2225 ratio = (msr >> 0) & 0xFF; in dump_hsw_turbo_ratio_limits()
2235 unsigned long long msr; in dump_ivt_turbo_ratio_limits() local
2238 get_msr(base_cpu, MSR_TURBO_RATIO_LIMIT1, &msr); in dump_ivt_turbo_ratio_limits()
2240 fprintf(outf, "cpu%d: MSR_TURBO_RATIO_LIMIT1: 0x%08llx\n", base_cpu, msr); in dump_ivt_turbo_ratio_limits()
2242 ratio = (msr >> 56) & 0xFF; in dump_ivt_turbo_ratio_limits()
2247 ratio = (msr >> 48) & 0xFF; in dump_ivt_turbo_ratio_limits()
2252 ratio = (msr >> 40) & 0xFF; in dump_ivt_turbo_ratio_limits()
2257 ratio = (msr >> 32) & 0xFF; in dump_ivt_turbo_ratio_limits()
2262 ratio = (msr >> 24) & 0xFF; in dump_ivt_turbo_ratio_limits()
2267 ratio = (msr >> 16) & 0xFF; in dump_ivt_turbo_ratio_limits()
2272 ratio = (msr >> 8) & 0xFF; in dump_ivt_turbo_ratio_limits()
2277 ratio = (msr >> 0) & 0xFF; in dump_ivt_turbo_ratio_limits()
2302 unsigned long long msr, core_counts; in dump_turbo_ratio_limits() local
2305 get_msr(base_cpu, MSR_TURBO_RATIO_LIMIT, &msr); in dump_turbo_ratio_limits()
2306 fprintf(outf, "cpu%d: MSR_TURBO_RATIO_LIMIT: 0x%08llx\n", base_cpu, msr); in dump_turbo_ratio_limits()
2315 ratio = (msr >> 56) & 0xFF; in dump_turbo_ratio_limits()
2321 ratio = (msr >> 48) & 0xFF; in dump_turbo_ratio_limits()
2327 ratio = (msr >> 40) & 0xFF; in dump_turbo_ratio_limits()
2333 ratio = (msr >> 32) & 0xFF; in dump_turbo_ratio_limits()
2339 ratio = (msr >> 24) & 0xFF; in dump_turbo_ratio_limits()
2345 ratio = (msr >> 16) & 0xFF; in dump_turbo_ratio_limits()
2351 ratio = (msr >> 8) & 0xFF; in dump_turbo_ratio_limits()
2357 ratio = (msr >> 0) & 0xFF; in dump_turbo_ratio_limits()
2368 unsigned long long msr; in dump_atom_turbo_ratio_limits() local
2371 get_msr(base_cpu, MSR_ATOM_CORE_RATIOS, &msr); in dump_atom_turbo_ratio_limits()
2372 fprintf(outf, "cpu%d: MSR_ATOM_CORE_RATIOS: 0x%08llx\n", base_cpu, msr & 0xFFFFFFFF); in dump_atom_turbo_ratio_limits()
2374 ratio = (msr >> 0) & 0x3F; in dump_atom_turbo_ratio_limits()
2379 ratio = (msr >> 8) & 0x3F; in dump_atom_turbo_ratio_limits()
2384 ratio = (msr >> 16) & 0x3F; in dump_atom_turbo_ratio_limits()
2389 get_msr(base_cpu, MSR_ATOM_CORE_TURBO_RATIOS, &msr); in dump_atom_turbo_ratio_limits()
2390 fprintf(outf, "cpu%d: MSR_ATOM_CORE_TURBO_RATIOS: 0x%08llx\n", base_cpu, msr & 0xFFFFFFFF); in dump_atom_turbo_ratio_limits()
2392 ratio = (msr >> 24) & 0x3F; in dump_atom_turbo_ratio_limits()
2397 ratio = (msr >> 16) & 0x3F; in dump_atom_turbo_ratio_limits()
2402 ratio = (msr >> 8) & 0x3F; in dump_atom_turbo_ratio_limits()
2407 ratio = (msr >> 0) & 0x3F; in dump_atom_turbo_ratio_limits()
2418 unsigned long long msr; in dump_knl_turbo_ratio_limits() local
2424 get_msr(base_cpu, MSR_TURBO_RATIO_LIMIT, &msr); in dump_knl_turbo_ratio_limits()
2427 base_cpu, msr); in dump_knl_turbo_ratio_limits()
2453 cores[b_nr] = (msr & 0xFF) >> 1; in dump_knl_turbo_ratio_limits()
2454 ratio[b_nr] = (msr >> 8) & 0xFF; in dump_knl_turbo_ratio_limits()
2457 delta_cores = (msr >> i) & 0x1F; in dump_knl_turbo_ratio_limits()
2458 delta_ratio = (msr >> (i + 5)) & 0x7; in dump_knl_turbo_ratio_limits()
2475 unsigned long long msr; in dump_nhm_cst_cfg() local
2477 get_msr(base_cpu, MSR_PKG_CST_CONFIG_CONTROL, &msr); in dump_nhm_cst_cfg()
2479 fprintf(outf, "cpu%d: MSR_PKG_CST_CONFIG_CONTROL: 0x%08llx", base_cpu, msr); in dump_nhm_cst_cfg()
2482 (msr & SNB_C3_AUTO_UNDEMOTE) ? "UNdemote-C3, " : "", in dump_nhm_cst_cfg()
2483 (msr & SNB_C1_AUTO_UNDEMOTE) ? "UNdemote-C1, " : "", in dump_nhm_cst_cfg()
2484 (msr & NHM_C3_AUTO_DEMOTE) ? "demote-C3, " : "", in dump_nhm_cst_cfg()
2485 (msr & NHM_C1_AUTO_DEMOTE) ? "demote-C1, " : "", in dump_nhm_cst_cfg()
2486 (msr & (1 << 15)) ? "" : "UN", in dump_nhm_cst_cfg()
2487 (unsigned int)msr & 0xF, in dump_nhm_cst_cfg()
2493 (msr & AUTOMATIC_CSTATE_CONVERSION) ? "on" : "off"); in dump_nhm_cst_cfg()
2504 unsigned long long msr; in dump_config_tdp() local
2506 get_msr(base_cpu, MSR_CONFIG_TDP_NOMINAL, &msr); in dump_config_tdp()
2507 fprintf(outf, "cpu%d: MSR_CONFIG_TDP_NOMINAL: 0x%08llx", base_cpu, msr); in dump_config_tdp()
2508 fprintf(outf, " (base_ratio=%d)\n", (unsigned int)msr & 0xFF); in dump_config_tdp()
2510 get_msr(base_cpu, MSR_CONFIG_TDP_LEVEL_1, &msr); in dump_config_tdp()
2511 fprintf(outf, "cpu%d: MSR_CONFIG_TDP_LEVEL_1: 0x%08llx (", base_cpu, msr); in dump_config_tdp()
2512 if (msr) { in dump_config_tdp()
2513 fprintf(outf, "PKG_MIN_PWR_LVL1=%d ", (unsigned int)(msr >> 48) & 0x7FFF); in dump_config_tdp()
2514 fprintf(outf, "PKG_MAX_PWR_LVL1=%d ", (unsigned int)(msr >> 32) & 0x7FFF); in dump_config_tdp()
2515 fprintf(outf, "LVL1_RATIO=%d ", (unsigned int)(msr >> 16) & 0xFF); in dump_config_tdp()
2516 fprintf(outf, "PKG_TDP_LVL1=%d", (unsigned int)(msr) & 0x7FFF); in dump_config_tdp()
2520 get_msr(base_cpu, MSR_CONFIG_TDP_LEVEL_2, &msr); in dump_config_tdp()
2521 fprintf(outf, "cpu%d: MSR_CONFIG_TDP_LEVEL_2: 0x%08llx (", base_cpu, msr); in dump_config_tdp()
2522 if (msr) { in dump_config_tdp()
2523 fprintf(outf, "PKG_MIN_PWR_LVL2=%d ", (unsigned int)(msr >> 48) & 0x7FFF); in dump_config_tdp()
2524 fprintf(outf, "PKG_MAX_PWR_LVL2=%d ", (unsigned int)(msr >> 32) & 0x7FFF); in dump_config_tdp()
2525 fprintf(outf, "LVL2_RATIO=%d ", (unsigned int)(msr >> 16) & 0xFF); in dump_config_tdp()
2526 fprintf(outf, "PKG_TDP_LVL2=%d", (unsigned int)(msr) & 0x7FFF); in dump_config_tdp()
2530 get_msr(base_cpu, MSR_CONFIG_TDP_CONTROL, &msr); in dump_config_tdp()
2531 fprintf(outf, "cpu%d: MSR_CONFIG_TDP_CONTROL: 0x%08llx (", base_cpu, msr); in dump_config_tdp()
2532 if ((msr) & 0x3) in dump_config_tdp()
2533 fprintf(outf, "TDP_LEVEL=%d ", (unsigned int)(msr) & 0x3); in dump_config_tdp()
2534 fprintf(outf, " lock=%d", (unsigned int)(msr >> 31) & 1); in dump_config_tdp()
2537 get_msr(base_cpu, MSR_TURBO_ACTIVATION_RATIO, &msr); in dump_config_tdp()
2538 fprintf(outf, "cpu%d: MSR_TURBO_ACTIVATION_RATIO: 0x%08llx (", base_cpu, msr); in dump_config_tdp()
2539 fprintf(outf, "MAX_NON_TURBO_RATIO=%d", (unsigned int)(msr) & 0xFF); in dump_config_tdp()
2540 fprintf(outf, " lock=%d", (unsigned int)(msr >> 31) & 1); in dump_config_tdp()
2548 unsigned long long msr; in print_irtl() local
2550 get_msr(base_cpu, MSR_PKGC3_IRTL, &msr); in print_irtl()
2551 fprintf(outf, "cpu%d: MSR_PKGC3_IRTL: 0x%08llx (", base_cpu, msr); in print_irtl()
2552 fprintf(outf, "%svalid, %lld ns)\n", msr & (1 << 15) ? "" : "NOT", in print_irtl()
2553 (msr & 0x3FF) * irtl_time_units[(msr >> 10) & 0x3]); in print_irtl()
2555 get_msr(base_cpu, MSR_PKGC6_IRTL, &msr); in print_irtl()
2556 fprintf(outf, "cpu%d: MSR_PKGC6_IRTL: 0x%08llx (", base_cpu, msr); in print_irtl()
2557 fprintf(outf, "%svalid, %lld ns)\n", msr & (1 << 15) ? "" : "NOT", in print_irtl()
2558 (msr & 0x3FF) * irtl_time_units[(msr >> 10) & 0x3]); in print_irtl()
2560 get_msr(base_cpu, MSR_PKGC7_IRTL, &msr); in print_irtl()
2561 fprintf(outf, "cpu%d: MSR_PKGC7_IRTL: 0x%08llx (", base_cpu, msr); in print_irtl()
2562 fprintf(outf, "%svalid, %lld ns)\n", msr & (1 << 15) ? "" : "NOT", in print_irtl()
2563 (msr & 0x3FF) * irtl_time_units[(msr >> 10) & 0x3]); in print_irtl()
2568 get_msr(base_cpu, MSR_PKGC8_IRTL, &msr); in print_irtl()
2569 fprintf(outf, "cpu%d: MSR_PKGC8_IRTL: 0x%08llx (", base_cpu, msr); in print_irtl()
2570 fprintf(outf, "%svalid, %lld ns)\n", msr & (1 << 15) ? "" : "NOT", in print_irtl()
2571 (msr & 0x3FF) * irtl_time_units[(msr >> 10) & 0x3]); in print_irtl()
2573 get_msr(base_cpu, MSR_PKGC9_IRTL, &msr); in print_irtl()
2574 fprintf(outf, "cpu%d: MSR_PKGC9_IRTL: 0x%08llx (", base_cpu, msr); in print_irtl()
2575 fprintf(outf, "%svalid, %lld ns)\n", msr & (1 << 15) ? "" : "NOT", in print_irtl()
2576 (msr & 0x3FF) * irtl_time_units[(msr >> 10) & 0x3]); in print_irtl()
2578 get_msr(base_cpu, MSR_PKGC10_IRTL, &msr); in print_irtl()
2579 fprintf(outf, "cpu%d: MSR_PKGC10_IRTL: 0x%08llx (", base_cpu, msr); in print_irtl()
2580 fprintf(outf, "%svalid, %lld ns)\n", msr & (1 << 15) ? "" : "NOT", in print_irtl()
2581 (msr & 0x3FF) * irtl_time_units[(msr >> 10) & 0x3]); in print_irtl()
3220 int get_msr_sum(int cpu, off_t offset, unsigned long long *msr) in get_msr_sum() argument
3237 *msr = msr_last + per_cpu_msr_sum[cpu].entries[idx].sum; in get_msr_sum()
3492 unsigned long long msr; in probe_nhm_msrs() local
3554 get_msr(base_cpu, MSR_PKG_CST_CONFIG_CONTROL, &msr); in probe_nhm_msrs()
3555 pkg_cstate_limit = pkg_cstate_limits[msr & 0xF]; in probe_nhm_msrs()
3557 get_msr(base_cpu, MSR_PLATFORM_INFO, &msr); in probe_nhm_msrs()
3558 base_ratio = (msr >> 8) & 0xFF; in probe_nhm_msrs()
3925 unsigned long long msr; in print_epb() local
3943 if (get_msr(cpu, MSR_IA32_ENERGY_PERF_BIAS, &msr)) in print_epb()
3946 switch (msr & 0xF) { in print_epb()
3960 fprintf(outf, "cpu%d: MSR_IA32_ENERGY_PERF_BIAS: 0x%08llx (%s)\n", cpu, msr, epb_string); in print_epb()
3970 unsigned long long msr; in print_hwp() local
3987 if (get_msr(cpu, MSR_PM_ENABLE, &msr)) in print_hwp()
3991 cpu, msr, (msr & (1 << 0)) ? "" : "No-"); in print_hwp()
3994 if ((msr & (1 << 0)) == 0) in print_hwp()
3997 if (get_msr(cpu, MSR_HWP_CAPABILITIES, &msr)) in print_hwp()
4002 cpu, msr, in print_hwp()
4003 (unsigned int)HWP_HIGHEST_PERF(msr), in print_hwp()
4004 (unsigned int)HWP_GUARANTEED_PERF(msr), in print_hwp()
4005 (unsigned int)HWP_MOSTEFFICIENT_PERF(msr), in print_hwp()
4006 (unsigned int)HWP_LOWEST_PERF(msr)); in print_hwp()
4008 if (get_msr(cpu, MSR_HWP_REQUEST, &msr)) in print_hwp()
4013 cpu, msr, in print_hwp()
4014 (unsigned int)(((msr) >> 0) & 0xff), in print_hwp()
4015 (unsigned int)(((msr) >> 8) & 0xff), in print_hwp()
4016 (unsigned int)(((msr) >> 16) & 0xff), in print_hwp()
4017 (unsigned int)(((msr) >> 24) & 0xff), in print_hwp()
4018 (unsigned int)(((msr) >> 32) & 0xff3), in print_hwp()
4019 (unsigned int)(((msr) >> 42) & 0x1)); in print_hwp()
4022 if (get_msr(cpu, MSR_HWP_REQUEST_PKG, &msr)) in print_hwp()
4027 cpu, msr, in print_hwp()
4028 (unsigned int)(((msr) >> 0) & 0xff), in print_hwp()
4029 (unsigned int)(((msr) >> 8) & 0xff), in print_hwp()
4030 (unsigned int)(((msr) >> 16) & 0xff), in print_hwp()
4031 (unsigned int)(((msr) >> 24) & 0xff), in print_hwp()
4032 (unsigned int)(((msr) >> 32) & 0xff3)); in print_hwp()
4035 if (get_msr(cpu, MSR_HWP_INTERRUPT, &msr)) in print_hwp()
4040 cpu, msr, in print_hwp()
4041 ((msr) & 0x1) ? "EN" : "Dis", in print_hwp()
4042 ((msr) & 0x2) ? "EN" : "Dis"); in print_hwp()
4044 if (get_msr(cpu, MSR_HWP_STATUS, &msr)) in print_hwp()
4049 cpu, msr, in print_hwp()
4050 ((msr) & 0x1) ? "" : "No-", in print_hwp()
4051 ((msr) & 0x2) ? "" : "No-"); in print_hwp()
4061 unsigned long long msr; in print_perf_limit() local
4076 get_msr(cpu, MSR_CORE_PERF_LIMIT_REASONS, &msr); in print_perf_limit()
4077 fprintf(outf, "cpu%d: MSR_CORE_PERF_LIMIT_REASONS, 0x%08llx", cpu, msr); in print_perf_limit()
4079 (msr & 1 << 15) ? "bit15, " : "", in print_perf_limit()
4080 (msr & 1 << 14) ? "bit14, " : "", in print_perf_limit()
4081 (msr & 1 << 13) ? "Transitions, " : "", in print_perf_limit()
4082 (msr & 1 << 12) ? "MultiCoreTurbo, " : "", in print_perf_limit()
4083 (msr & 1 << 11) ? "PkgPwrL2, " : "", in print_perf_limit()
4084 (msr & 1 << 10) ? "PkgPwrL1, " : "", in print_perf_limit()
4085 (msr & 1 << 9) ? "CorePwr, " : "", in print_perf_limit()
4086 (msr & 1 << 8) ? "Amps, " : "", in print_perf_limit()
4087 (msr & 1 << 6) ? "VR-Therm, " : "", in print_perf_limit()
4088 (msr & 1 << 5) ? "Auto-HWP, " : "", in print_perf_limit()
4089 (msr & 1 << 4) ? "Graphics, " : "", in print_perf_limit()
4090 (msr & 1 << 2) ? "bit2, " : "", in print_perf_limit()
4091 (msr & 1 << 1) ? "ThermStatus, " : "", in print_perf_limit()
4092 (msr & 1 << 0) ? "PROCHOT, " : ""); in print_perf_limit()
4094 (msr & 1 << 31) ? "bit31, " : "", in print_perf_limit()
4095 (msr & 1 << 30) ? "bit30, " : "", in print_perf_limit()
4096 (msr & 1 << 29) ? "Transitions, " : "", in print_perf_limit()
4097 (msr & 1 << 28) ? "MultiCoreTurbo, " : "", in print_perf_limit()
4098 (msr & 1 << 27) ? "PkgPwrL2, " : "", in print_perf_limit()
4099 (msr & 1 << 26) ? "PkgPwrL1, " : "", in print_perf_limit()
4100 (msr & 1 << 25) ? "CorePwr, " : "", in print_perf_limit()
4101 (msr & 1 << 24) ? "Amps, " : "", in print_perf_limit()
4102 (msr & 1 << 22) ? "VR-Therm, " : "", in print_perf_limit()
4103 (msr & 1 << 21) ? "Auto-HWP, " : "", in print_perf_limit()
4104 (msr & 1 << 20) ? "Graphics, " : "", in print_perf_limit()
4105 (msr & 1 << 18) ? "bit18, " : "", in print_perf_limit()
4106 (msr & 1 << 17) ? "ThermStatus, " : "", in print_perf_limit()
4107 (msr & 1 << 16) ? "PROCHOT, " : ""); in print_perf_limit()
4111 get_msr(cpu, MSR_GFX_PERF_LIMIT_REASONS, &msr); in print_perf_limit()
4112 fprintf(outf, "cpu%d: MSR_GFX_PERF_LIMIT_REASONS, 0x%08llx", cpu, msr); in print_perf_limit()
4114 (msr & 1 << 0) ? "PROCHOT, " : "", in print_perf_limit()
4115 (msr & 1 << 1) ? "ThermStatus, " : "", in print_perf_limit()
4116 (msr & 1 << 4) ? "Graphics, " : "", in print_perf_limit()
4117 (msr & 1 << 6) ? "VR-Therm, " : "", in print_perf_limit()
4118 (msr & 1 << 8) ? "Amps, " : "", in print_perf_limit()
4119 (msr & 1 << 9) ? "GFXPwr, " : "", in print_perf_limit()
4120 (msr & 1 << 10) ? "PkgPwrL1, " : "", in print_perf_limit()
4121 (msr & 1 << 11) ? "PkgPwrL2, " : ""); in print_perf_limit()
4123 (msr & 1 << 16) ? "PROCHOT, " : "", in print_perf_limit()
4124 (msr & 1 << 17) ? "ThermStatus, " : "", in print_perf_limit()
4125 (msr & 1 << 20) ? "Graphics, " : "", in print_perf_limit()
4126 (msr & 1 << 22) ? "VR-Therm, " : "", in print_perf_limit()
4127 (msr & 1 << 24) ? "Amps, " : "", in print_perf_limit()
4128 (msr & 1 << 25) ? "GFXPwr, " : "", in print_perf_limit()
4129 (msr & 1 << 26) ? "PkgPwrL1, " : "", in print_perf_limit()
4130 (msr & 1 << 27) ? "PkgPwrL2, " : ""); in print_perf_limit()
4133 get_msr(cpu, MSR_RING_PERF_LIMIT_REASONS, &msr); in print_perf_limit()
4134 fprintf(outf, "cpu%d: MSR_RING_PERF_LIMIT_REASONS, 0x%08llx", cpu, msr); in print_perf_limit()
4136 (msr & 1 << 0) ? "PROCHOT, " : "", in print_perf_limit()
4137 (msr & 1 << 1) ? "ThermStatus, " : "", in print_perf_limit()
4138 (msr & 1 << 6) ? "VR-Therm, " : "", in print_perf_limit()
4139 (msr & 1 << 8) ? "Amps, " : "", in print_perf_limit()
4140 (msr & 1 << 10) ? "PkgPwrL1, " : "", in print_perf_limit()
4141 (msr & 1 << 11) ? "PkgPwrL2, " : ""); in print_perf_limit()
4143 (msr & 1 << 16) ? "PROCHOT, " : "", in print_perf_limit()
4144 (msr & 1 << 17) ? "ThermStatus, " : "", in print_perf_limit()
4145 (msr & 1 << 22) ? "VR-Therm, " : "", in print_perf_limit()
4146 (msr & 1 << 24) ? "Amps, " : "", in print_perf_limit()
4147 (msr & 1 << 26) ? "PkgPwrL1, " : "", in print_perf_limit()
4148 (msr & 1 << 27) ? "PkgPwrL2, " : ""); in print_perf_limit()
4158 unsigned long long msr; in get_tdp_intel() local
4161 if (!get_msr(base_cpu, MSR_PKG_POWER_INFO, &msr)) in get_tdp_intel()
4162 return ((msr >> 0) & RAPL_POWER_GRANULARITY) * rapl_power_units; in get_tdp_intel()
4201 unsigned long long msr; in rapl_probe_intel() local
4334 if (get_msr(base_cpu, MSR_RAPL_POWER_UNIT, &msr)) in rapl_probe_intel()
4337 rapl_power_units = 1.0 / (1 << (msr & 0xF)); in rapl_probe_intel()
4339 rapl_energy_units = 1.0 * (1 << (msr >> 8 & 0x1F)) / 1000000; in rapl_probe_intel()
4341 rapl_energy_units = 1.0 / (1 << (msr >> 8 & 0x1F)); in rapl_probe_intel()
4345 time_unit = msr >> 16 & 0xF; in rapl_probe_intel()
4360 unsigned long long msr; in rapl_probe_amd() local
4383 if (get_msr(base_cpu, MSR_RAPL_PWR_UNIT, &msr)) in rapl_probe_amd()
4386 rapl_time_units = ldexp(1.0, -(msr >> 16 & 0xf)); in rapl_probe_amd()
4387 rapl_energy_units = ldexp(1.0, -(msr >> 8 & 0x1f)); in rapl_probe_amd()
4388 rapl_power_units = ldexp(1.0, -(msr & 0xf)); in rapl_probe_amd()
4439 unsigned long long msr; in print_thermal() local
4458 if (get_msr(cpu, MSR_IA32_PACKAGE_THERM_STATUS, &msr)) in print_thermal()
4461 dts = (msr >> 16) & 0x7F; in print_thermal()
4463 cpu, msr, tcc_activation_temp - dts); in print_thermal()
4465 if (get_msr(cpu, MSR_IA32_PACKAGE_THERM_INTERRUPT, &msr)) in print_thermal()
4468 dts = (msr >> 16) & 0x7F; in print_thermal()
4469 dts2 = (msr >> 8) & 0x7F; in print_thermal()
4471 cpu, msr, tcc_activation_temp - dts, tcc_activation_temp - dts2); in print_thermal()
4478 if (get_msr(cpu, MSR_IA32_THERM_STATUS, &msr)) in print_thermal()
4481 dts = (msr >> 16) & 0x7F; in print_thermal()
4482 resolution = (msr >> 27) & 0xF; in print_thermal()
4484 cpu, msr, tcc_activation_temp - dts, resolution); in print_thermal()
4486 if (get_msr(cpu, MSR_IA32_THERM_INTERRUPT, &msr)) in print_thermal()
4489 dts = (msr >> 16) & 0x7F; in print_thermal()
4490 dts2 = (msr >> 8) & 0x7F; in print_thermal()
4492 cpu, msr, tcc_activation_temp - dts, tcc_activation_temp - dts2); in print_thermal()
4498 void print_power_limit_msr(int cpu, unsigned long long msr, char *label) in print_power_limit_msr() argument
4502 ((msr >> 15) & 1) ? "EN" : "DIS", in print_power_limit_msr()
4503 ((msr >> 0) & 0x7FFF) * rapl_power_units, in print_power_limit_msr()
4504 (1.0 + (((msr >> 22) & 0x3)/4.0)) * (1 << ((msr >> 17) & 0x1F)) * rapl_time_units, in print_power_limit_msr()
4505 (((msr >> 16) & 1) ? "EN" : "DIS")); in print_power_limit_msr()
4512 unsigned long long msr; in print_rapl() local
4531 if (get_msr(cpu, MSR_RAPL_PWR_UNIT, &msr)) in print_rapl()
4535 if (get_msr(cpu, MSR_RAPL_POWER_UNIT, &msr)) in print_rapl()
4539 fprintf(outf, "cpu%d: %s: 0x%08llx (%f Watts, %f Joules, %f sec.)\n", cpu, msr_name, msr, in print_rapl()
4544 if (get_msr(cpu, MSR_PKG_POWER_INFO, &msr)) in print_rapl()
4549 cpu, msr, in print_rapl()
4550 ((msr >> 0) & RAPL_POWER_GRANULARITY) * rapl_power_units, in print_rapl()
4551 ((msr >> 16) & RAPL_POWER_GRANULARITY) * rapl_power_units, in print_rapl()
4552 ((msr >> 32) & RAPL_POWER_GRANULARITY) * rapl_power_units, in print_rapl()
4553 ((msr >> 48) & RAPL_TIME_GRANULARITY) * rapl_time_units); in print_rapl()
4558 if (get_msr(cpu, MSR_PKG_POWER_LIMIT, &msr)) in print_rapl()
4562 cpu, msr, (msr >> 63) & 1 ? "" : "UN"); in print_rapl()
4564 print_power_limit_msr(cpu, msr, "PKG Limit #1"); in print_rapl()
4567 ((msr >> 47) & 1) ? "EN" : "DIS", in print_rapl()
4568 ((msr >> 32) & 0x7FFF) * rapl_power_units, in print_rapl()
4569 (1.0 + (((msr >> 54) & 0x3)/4.0)) * (1 << ((msr >> 49) & 0x1F)) * rapl_time_units, in print_rapl()
4570 ((msr >> 48) & 1) ? "EN" : "DIS"); in print_rapl()
4574 if (get_msr(cpu, MSR_DRAM_POWER_INFO, &msr)) in print_rapl()
4578 cpu, msr, in print_rapl()
4579 ((msr >> 0) & RAPL_POWER_GRANULARITY) * rapl_power_units, in print_rapl()
4580 ((msr >> 16) & RAPL_POWER_GRANULARITY) * rapl_power_units, in print_rapl()
4581 ((msr >> 32) & RAPL_POWER_GRANULARITY) * rapl_power_units, in print_rapl()
4582 ((msr >> 48) & RAPL_TIME_GRANULARITY) * rapl_time_units); in print_rapl()
4585 if (get_msr(cpu, MSR_DRAM_POWER_LIMIT, &msr)) in print_rapl()
4588 cpu, msr, (msr >> 31) & 1 ? "" : "UN"); in print_rapl()
4590 print_power_limit_msr(cpu, msr, "DRAM Limit"); in print_rapl()
4593 if (get_msr(cpu, MSR_PP0_POLICY, &msr)) in print_rapl()
4596 fprintf(outf, "cpu%d: MSR_PP0_POLICY: %lld\n", cpu, msr & 0xF); in print_rapl()
4599 if (get_msr(cpu, MSR_PP0_POWER_LIMIT, &msr)) in print_rapl()
4602 cpu, msr, (msr >> 31) & 1 ? "" : "UN"); in print_rapl()
4603 print_power_limit_msr(cpu, msr, "Cores Limit"); in print_rapl()
4606 if (get_msr(cpu, MSR_PP1_POLICY, &msr)) in print_rapl()
4609 fprintf(outf, "cpu%d: MSR_PP1_POLICY: %lld\n", cpu, msr & 0xF); in print_rapl()
4611 if (get_msr(cpu, MSR_PP1_POWER_LIMIT, &msr)) in print_rapl()
4614 cpu, msr, (msr >> 31) & 1 ? "" : "UN"); in print_rapl()
4615 print_power_limit_msr(cpu, msr, "GFX Limit"); in print_rapl()
4757 unsigned long long msr = 3; in slm_bclk() local
4761 if (get_msr(base_cpu, MSR_FSB_FREQ, &msr)) in slm_bclk()
4764 i = msr & 0xf; in slm_bclk()
4801 unsigned long long msr; in set_temperature_target() local
4830 if (get_msr(base_cpu, MSR_IA32_TEMPERATURE_TARGET, &msr)) in set_temperature_target()
4833 target_c_local = (msr >> 16) & 0xFF; in set_temperature_target()
4837 cpu, msr, target_c_local); in set_temperature_target()
4856 unsigned long long msr; in decode_feature_control_msr() local
4858 if (!get_msr(base_cpu, MSR_IA32_FEAT_CTL, &msr)) in decode_feature_control_msr()
4860 base_cpu, msr, in decode_feature_control_msr()
4861 msr & FEAT_CTL_LOCKED ? "" : "UN-", in decode_feature_control_msr()
4862 msr & (1 << 18) ? "SGX" : ""); in decode_feature_control_msr()
4867 unsigned long long msr; in decode_misc_enable_msr() local
4872 if (!get_msr(base_cpu, MSR_IA32_MISC_ENABLE, &msr)) in decode_misc_enable_msr()
4874 base_cpu, msr, in decode_misc_enable_msr()
4875 msr & MSR_IA32_MISC_ENABLE_TM1 ? "" : "No-", in decode_misc_enable_msr()
4876 msr & MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP ? "" : "No-", in decode_misc_enable_msr()
4877 msr & MSR_IA32_MISC_ENABLE_MWAIT ? "" : "No-", in decode_misc_enable_msr()
4878 msr & MSR_IA32_MISC_ENABLE_PREFETCH_DISABLE ? "No-" : "", in decode_misc_enable_msr()
4879 msr & MSR_IA32_MISC_ENABLE_TURBO_DISABLE ? "No-" : ""); in decode_misc_enable_msr()
4884 unsigned long long msr; in decode_misc_feature_control() local
4889 if (!get_msr(base_cpu, MSR_MISC_FEATURE_CONTROL, &msr)) in decode_misc_feature_control()
4891 base_cpu, msr, in decode_misc_feature_control()
4892 msr & (0 << 0) ? "No-" : "", in decode_misc_feature_control()
4893 msr & (1 << 0) ? "No-" : "", in decode_misc_feature_control()
4894 msr & (2 << 0) ? "No-" : "", in decode_misc_feature_control()
4895 msr & (3 << 0) ? "No-" : ""); in decode_misc_feature_control()
4906 unsigned long long msr; in decode_misc_pwr_mgmt_msr() local
4914 if (!get_msr(base_cpu, MSR_MISC_PWR_MGMT, &msr)) in decode_misc_pwr_mgmt_msr()
4916 base_cpu, msr, in decode_misc_pwr_mgmt_msr()
4917 msr & (1 << 0) ? "DIS" : "EN", in decode_misc_pwr_mgmt_msr()
4918 msr & (1 << 1) ? "EN" : "DIS", in decode_misc_pwr_mgmt_msr()
4919 msr & (1 << 8) ? "EN" : "DIS"); in decode_misc_pwr_mgmt_msr()
4929 unsigned long long msr; in decode_c6_demotion_policy_msr() local
4931 if (!get_msr(base_cpu, MSR_CC6_DEMOTION_POLICY_CONFIG, &msr)) in decode_c6_demotion_policy_msr()
4933 base_cpu, msr, msr & (1 << 0) ? "EN" : "DIS"); in decode_c6_demotion_policy_msr()
4935 if (!get_msr(base_cpu, MSR_MC6_DEMOTION_POLICY_CONFIG, &msr)) in decode_c6_demotion_policy_msr()
4937 base_cpu, msr, msr & (1 << 0) ? "EN" : "DIS"); in decode_c6_demotion_policy_msr()