Lines Matching refs:msr

291 int get_msr_sum(int cpu, off_t offset, unsigned long long *msr);
541 int get_msr(int cpu, off_t offset, unsigned long long *msr) in get_msr() argument
545 retval = pread(get_msr_fd(cpu), msr, sizeof(*msr), offset); in get_msr()
547 if (retval != sizeof *msr) in get_msr()
1918 unsigned long long msr; in get_epb() local
1937 get_msr(cpu, MSR_IA32_ENERGY_PERF_BIAS, &msr); in get_epb()
1939 return msr & 0xf; in get_epb()
1998 unsigned long long msr; in get_counters() local
2077 if (get_msr(cpu, MSR_SMI_COUNT, &msr)) in get_counters()
2079 t->smi_count = msr & 0xFFFFFFFF; in get_counters()
2127 if (get_msr(cpu, MSR_IA32_THERM_STATUS, &msr)) in get_counters()
2129 c->core_temp_c = tj_max - ((msr >> 16) & 0x7F); in get_counters()
2133 if (get_msr(cpu, MSR_CORE_ENERGY_STAT, &msr)) in get_counters()
2135 c->core_energy = msr & 0xFFFFFFFF; in get_counters()
2198 if (get_msr_sum(cpu, MSR_PKG_ENERGY_STATUS, &msr)) in get_counters()
2200 p->energy_pkg = msr; in get_counters()
2203 if (get_msr_sum(cpu, MSR_PP0_ENERGY_STATUS, &msr)) in get_counters()
2205 p->energy_cores = msr; in get_counters()
2208 if (get_msr_sum(cpu, MSR_DRAM_ENERGY_STATUS, &msr)) in get_counters()
2210 p->energy_dram = msr; in get_counters()
2213 if (get_msr_sum(cpu, MSR_PP1_ENERGY_STATUS, &msr)) in get_counters()
2215 p->energy_gfx = msr; in get_counters()
2218 if (get_msr_sum(cpu, MSR_PKG_PERF_STATUS, &msr)) in get_counters()
2220 p->rapl_pkg_perf_status = msr; in get_counters()
2223 if (get_msr_sum(cpu, MSR_DRAM_PERF_STATUS, &msr)) in get_counters()
2225 p->rapl_dram_perf_status = msr; in get_counters()
2228 if (get_msr_sum(cpu, MSR_PKG_ENERGY_STAT, &msr)) in get_counters()
2230 p->energy_pkg = msr; in get_counters()
2233 if (get_msr(cpu, MSR_IA32_PACKAGE_THERM_STATUS, &msr)) in get_counters()
2235 p->pkg_temp_c = tj_max - ((msr >> 16) & 0x7F); in get_counters()
2339 unsigned long long msr; in dump_nhm_platform_info() local
2342 get_msr(base_cpu, MSR_PLATFORM_INFO, &msr); in dump_nhm_platform_info()
2344 fprintf(outf, "cpu%d: MSR_PLATFORM_INFO: 0x%08llx\n", base_cpu, msr); in dump_nhm_platform_info()
2346 ratio = (msr >> 40) & 0xFF; in dump_nhm_platform_info()
2349 ratio = (msr >> 8) & 0xFF; in dump_nhm_platform_info()
2352 get_msr(base_cpu, MSR_IA32_POWER_CTL, &msr); in dump_nhm_platform_info()
2354 base_cpu, msr, msr & 0x2 ? "EN" : "DIS"); in dump_nhm_platform_info()
2358 fprintf(outf, "C-state Pre-wake: %sabled\n", msr & 0x40000000 ? "DIS" : "EN"); in dump_nhm_platform_info()
2365 unsigned long long msr; in dump_hsw_turbo_ratio_limits() local
2368 get_msr(base_cpu, MSR_TURBO_RATIO_LIMIT2, &msr); in dump_hsw_turbo_ratio_limits()
2370 fprintf(outf, "cpu%d: MSR_TURBO_RATIO_LIMIT2: 0x%08llx\n", base_cpu, msr); in dump_hsw_turbo_ratio_limits()
2372 ratio = (msr >> 8) & 0xFF; in dump_hsw_turbo_ratio_limits()
2376 ratio = (msr >> 0) & 0xFF; in dump_hsw_turbo_ratio_limits()
2384 unsigned long long msr; in dump_ivt_turbo_ratio_limits() local
2387 get_msr(base_cpu, MSR_TURBO_RATIO_LIMIT1, &msr); in dump_ivt_turbo_ratio_limits()
2389 fprintf(outf, "cpu%d: MSR_TURBO_RATIO_LIMIT1: 0x%08llx\n", base_cpu, msr); in dump_ivt_turbo_ratio_limits()
2391 ratio = (msr >> 56) & 0xFF; in dump_ivt_turbo_ratio_limits()
2395 ratio = (msr >> 48) & 0xFF; in dump_ivt_turbo_ratio_limits()
2399 ratio = (msr >> 40) & 0xFF; in dump_ivt_turbo_ratio_limits()
2403 ratio = (msr >> 32) & 0xFF; in dump_ivt_turbo_ratio_limits()
2407 ratio = (msr >> 24) & 0xFF; in dump_ivt_turbo_ratio_limits()
2411 ratio = (msr >> 16) & 0xFF; in dump_ivt_turbo_ratio_limits()
2415 ratio = (msr >> 8) & 0xFF; in dump_ivt_turbo_ratio_limits()
2419 ratio = (msr >> 0) & 0xFF; in dump_ivt_turbo_ratio_limits()
2444 unsigned long long msr, core_counts; in dump_turbo_ratio_limits() local
2447 get_msr(base_cpu, MSR_TURBO_RATIO_LIMIT, &msr); in dump_turbo_ratio_limits()
2448 fprintf(outf, "cpu%d: MSR_TURBO_RATIO_LIMIT: 0x%08llx\n", base_cpu, msr); in dump_turbo_ratio_limits()
2457 ratio = (msr >> 56) & 0xFF; in dump_turbo_ratio_limits()
2463 ratio = (msr >> 48) & 0xFF; in dump_turbo_ratio_limits()
2469 ratio = (msr >> 40) & 0xFF; in dump_turbo_ratio_limits()
2475 ratio = (msr >> 32) & 0xFF; in dump_turbo_ratio_limits()
2481 ratio = (msr >> 24) & 0xFF; in dump_turbo_ratio_limits()
2487 ratio = (msr >> 16) & 0xFF; in dump_turbo_ratio_limits()
2493 ratio = (msr >> 8) & 0xFF; in dump_turbo_ratio_limits()
2499 ratio = (msr >> 0) & 0xFF; in dump_turbo_ratio_limits()
2509 unsigned long long msr; in dump_atom_turbo_ratio_limits() local
2512 get_msr(base_cpu, MSR_ATOM_CORE_RATIOS, &msr); in dump_atom_turbo_ratio_limits()
2513 fprintf(outf, "cpu%d: MSR_ATOM_CORE_RATIOS: 0x%08llx\n", base_cpu, msr & 0xFFFFFFFF); in dump_atom_turbo_ratio_limits()
2515 ratio = (msr >> 0) & 0x3F; in dump_atom_turbo_ratio_limits()
2519 ratio = (msr >> 8) & 0x3F; in dump_atom_turbo_ratio_limits()
2523 ratio = (msr >> 16) & 0x3F; in dump_atom_turbo_ratio_limits()
2527 get_msr(base_cpu, MSR_ATOM_CORE_TURBO_RATIOS, &msr); in dump_atom_turbo_ratio_limits()
2528 fprintf(outf, "cpu%d: MSR_ATOM_CORE_TURBO_RATIOS: 0x%08llx\n", base_cpu, msr & 0xFFFFFFFF); in dump_atom_turbo_ratio_limits()
2530 ratio = (msr >> 24) & 0x3F; in dump_atom_turbo_ratio_limits()
2534 ratio = (msr >> 16) & 0x3F; in dump_atom_turbo_ratio_limits()
2538 ratio = (msr >> 8) & 0x3F; in dump_atom_turbo_ratio_limits()
2542 ratio = (msr >> 0) & 0x3F; in dump_atom_turbo_ratio_limits()
2551 unsigned long long msr; in dump_knl_turbo_ratio_limits() local
2557 get_msr(base_cpu, MSR_TURBO_RATIO_LIMIT, &msr); in dump_knl_turbo_ratio_limits()
2559 fprintf(outf, "cpu%d: MSR_TURBO_RATIO_LIMIT: 0x%08llx\n", base_cpu, msr); in dump_knl_turbo_ratio_limits()
2585 cores[b_nr] = (msr & 0xFF) >> 1; in dump_knl_turbo_ratio_limits()
2586 ratio[b_nr] = (msr >> 8) & 0xFF; in dump_knl_turbo_ratio_limits()
2589 delta_cores = (msr >> i) & 0x1F; in dump_knl_turbo_ratio_limits()
2590 delta_ratio = (msr >> (i + 5)) & 0x7; in dump_knl_turbo_ratio_limits()
2606 unsigned long long msr; in dump_nhm_cst_cfg() local
2608 get_msr(base_cpu, MSR_PKG_CST_CONFIG_CONTROL, &msr); in dump_nhm_cst_cfg()
2610 fprintf(outf, "cpu%d: MSR_PKG_CST_CONFIG_CONTROL: 0x%08llx", base_cpu, msr); in dump_nhm_cst_cfg()
2613 (msr & SNB_C3_AUTO_UNDEMOTE) ? "UNdemote-C3, " : "", in dump_nhm_cst_cfg()
2614 (msr & SNB_C1_AUTO_UNDEMOTE) ? "UNdemote-C1, " : "", in dump_nhm_cst_cfg()
2615 (msr & NHM_C3_AUTO_DEMOTE) ? "demote-C3, " : "", in dump_nhm_cst_cfg()
2616 (msr & NHM_C1_AUTO_DEMOTE) ? "demote-C1, " : "", in dump_nhm_cst_cfg()
2617 …(msr & (1 << 15)) ? "" : "UN", (unsigned int)msr & 0xF, pkg_cstate_limit_strings[pkg_cstate_limit]… in dump_nhm_cst_cfg()
2621 …fprintf(outf, ", automatic c-state conversion=%s", (msr & AUTOMATIC_CSTATE_CONVERSION) ? "on" : "o… in dump_nhm_cst_cfg()
2631 unsigned long long msr; in dump_config_tdp() local
2633 get_msr(base_cpu, MSR_CONFIG_TDP_NOMINAL, &msr); in dump_config_tdp()
2634 fprintf(outf, "cpu%d: MSR_CONFIG_TDP_NOMINAL: 0x%08llx", base_cpu, msr); in dump_config_tdp()
2635 fprintf(outf, " (base_ratio=%d)\n", (unsigned int)msr & 0xFF); in dump_config_tdp()
2637 get_msr(base_cpu, MSR_CONFIG_TDP_LEVEL_1, &msr); in dump_config_tdp()
2638 fprintf(outf, "cpu%d: MSR_CONFIG_TDP_LEVEL_1: 0x%08llx (", base_cpu, msr); in dump_config_tdp()
2639 if (msr) { in dump_config_tdp()
2640 fprintf(outf, "PKG_MIN_PWR_LVL1=%d ", (unsigned int)(msr >> 48) & 0x7FFF); in dump_config_tdp()
2641 fprintf(outf, "PKG_MAX_PWR_LVL1=%d ", (unsigned int)(msr >> 32) & 0x7FFF); in dump_config_tdp()
2642 fprintf(outf, "LVL1_RATIO=%d ", (unsigned int)(msr >> 16) & 0xFF); in dump_config_tdp()
2643 fprintf(outf, "PKG_TDP_LVL1=%d", (unsigned int)(msr) & 0x7FFF); in dump_config_tdp()
2647 get_msr(base_cpu, MSR_CONFIG_TDP_LEVEL_2, &msr); in dump_config_tdp()
2648 fprintf(outf, "cpu%d: MSR_CONFIG_TDP_LEVEL_2: 0x%08llx (", base_cpu, msr); in dump_config_tdp()
2649 if (msr) { in dump_config_tdp()
2650 fprintf(outf, "PKG_MIN_PWR_LVL2=%d ", (unsigned int)(msr >> 48) & 0x7FFF); in dump_config_tdp()
2651 fprintf(outf, "PKG_MAX_PWR_LVL2=%d ", (unsigned int)(msr >> 32) & 0x7FFF); in dump_config_tdp()
2652 fprintf(outf, "LVL2_RATIO=%d ", (unsigned int)(msr >> 16) & 0xFF); in dump_config_tdp()
2653 fprintf(outf, "PKG_TDP_LVL2=%d", (unsigned int)(msr) & 0x7FFF); in dump_config_tdp()
2657 get_msr(base_cpu, MSR_CONFIG_TDP_CONTROL, &msr); in dump_config_tdp()
2658 fprintf(outf, "cpu%d: MSR_CONFIG_TDP_CONTROL: 0x%08llx (", base_cpu, msr); in dump_config_tdp()
2659 if ((msr) & 0x3) in dump_config_tdp()
2660 fprintf(outf, "TDP_LEVEL=%d ", (unsigned int)(msr) & 0x3); in dump_config_tdp()
2661 fprintf(outf, " lock=%d", (unsigned int)(msr >> 31) & 1); in dump_config_tdp()
2664 get_msr(base_cpu, MSR_TURBO_ACTIVATION_RATIO, &msr); in dump_config_tdp()
2665 fprintf(outf, "cpu%d: MSR_TURBO_ACTIVATION_RATIO: 0x%08llx (", base_cpu, msr); in dump_config_tdp()
2666 fprintf(outf, "MAX_NON_TURBO_RATIO=%d", (unsigned int)(msr) & 0xFF); in dump_config_tdp()
2667 fprintf(outf, " lock=%d", (unsigned int)(msr >> 31) & 1); in dump_config_tdp()
2675 unsigned long long msr; in print_irtl() local
2677 get_msr(base_cpu, MSR_PKGC3_IRTL, &msr); in print_irtl()
2678 fprintf(outf, "cpu%d: MSR_PKGC3_IRTL: 0x%08llx (", base_cpu, msr); in print_irtl()
2679 fprintf(outf, "%svalid, %lld ns)\n", msr & (1 << 15) ? "" : "NOT", in print_irtl()
2680 (msr & 0x3FF) * irtl_time_units[(msr >> 10) & 0x3]); in print_irtl()
2682 get_msr(base_cpu, MSR_PKGC6_IRTL, &msr); in print_irtl()
2683 fprintf(outf, "cpu%d: MSR_PKGC6_IRTL: 0x%08llx (", base_cpu, msr); in print_irtl()
2684 fprintf(outf, "%svalid, %lld ns)\n", msr & (1 << 15) ? "" : "NOT", in print_irtl()
2685 (msr & 0x3FF) * irtl_time_units[(msr >> 10) & 0x3]); in print_irtl()
2687 get_msr(base_cpu, MSR_PKGC7_IRTL, &msr); in print_irtl()
2688 fprintf(outf, "cpu%d: MSR_PKGC7_IRTL: 0x%08llx (", base_cpu, msr); in print_irtl()
2689 fprintf(outf, "%svalid, %lld ns)\n", msr & (1 << 15) ? "" : "NOT", in print_irtl()
2690 (msr & 0x3FF) * irtl_time_units[(msr >> 10) & 0x3]); in print_irtl()
2695 get_msr(base_cpu, MSR_PKGC8_IRTL, &msr); in print_irtl()
2696 fprintf(outf, "cpu%d: MSR_PKGC8_IRTL: 0x%08llx (", base_cpu, msr); in print_irtl()
2697 fprintf(outf, "%svalid, %lld ns)\n", msr & (1 << 15) ? "" : "NOT", in print_irtl()
2698 (msr & 0x3FF) * irtl_time_units[(msr >> 10) & 0x3]); in print_irtl()
2700 get_msr(base_cpu, MSR_PKGC9_IRTL, &msr); in print_irtl()
2701 fprintf(outf, "cpu%d: MSR_PKGC9_IRTL: 0x%08llx (", base_cpu, msr); in print_irtl()
2702 fprintf(outf, "%svalid, %lld ns)\n", msr & (1 << 15) ? "" : "NOT", in print_irtl()
2703 (msr & 0x3FF) * irtl_time_units[(msr >> 10) & 0x3]); in print_irtl()
2705 get_msr(base_cpu, MSR_PKGC10_IRTL, &msr); in print_irtl()
2706 fprintf(outf, "cpu%d: MSR_PKGC10_IRTL: 0x%08llx (", base_cpu, msr); in print_irtl()
2707 fprintf(outf, "%svalid, %lld ns)\n", msr & (1 << 15) ? "" : "NOT", in print_irtl()
2708 (msr & 0x3FF) * irtl_time_units[(msr >> 10) & 0x3]); in print_irtl()
3334 int get_msr_sum(int cpu, off_t offset, unsigned long long *msr) in get_msr_sum() argument
3351 *msr = msr_last + per_cpu_msr_sum[cpu].entries[idx].sum; in get_msr_sum()
3635 unsigned long long msr; in probe_nhm_msrs() local
3701 get_msr(base_cpu, MSR_PKG_CST_CONFIG_CONTROL, &msr); in probe_nhm_msrs()
3702 pkg_cstate_limit = pkg_cstate_limits[msr & 0xF]; in probe_nhm_msrs()
3704 get_msr(base_cpu, MSR_PLATFORM_INFO, &msr); in probe_nhm_msrs()
3705 base_ratio = (msr >> 8) & 0xFF; in probe_nhm_msrs()
3936 unsigned long long msr; in check_tcc_offset() local
3951 if (!get_msr(base_cpu, MSR_PLATFORM_INFO, &msr)) { in check_tcc_offset()
3952 msr = (msr >> 30) & 1; in check_tcc_offset()
3953 if (msr) in check_tcc_offset()
4171 unsigned long long msr; in print_hwp() local
4188 if (get_msr(cpu, MSR_PM_ENABLE, &msr)) in print_hwp()
4191 fprintf(outf, "cpu%d: MSR_PM_ENABLE: 0x%08llx (%sHWP)\n", cpu, msr, (msr & (1 << 0)) ? "" : "No-"); in print_hwp()
4194 if ((msr & (1 << 0)) == 0) in print_hwp()
4197 if (get_msr(cpu, MSR_HWP_CAPABILITIES, &msr)) in print_hwp()
4202 cpu, msr, in print_hwp()
4203 (unsigned int)HWP_HIGHEST_PERF(msr), in print_hwp()
4204 (unsigned int)HWP_GUARANTEED_PERF(msr), in print_hwp()
4205 (unsigned int)HWP_MOSTEFFICIENT_PERF(msr), (unsigned int)HWP_LOWEST_PERF(msr)); in print_hwp()
4207 if (get_msr(cpu, MSR_HWP_REQUEST, &msr)) in print_hwp()
4212 cpu, msr, in print_hwp()
4213 (unsigned int)(((msr) >> 0) & 0xff), in print_hwp()
4214 (unsigned int)(((msr) >> 8) & 0xff), in print_hwp()
4215 (unsigned int)(((msr) >> 16) & 0xff), in print_hwp()
4216 (unsigned int)(((msr) >> 24) & 0xff), in print_hwp()
4217 (unsigned int)(((msr) >> 32) & 0xff3), (unsigned int)(((msr) >> 42) & 0x1)); in print_hwp()
4220 if (get_msr(cpu, MSR_HWP_REQUEST_PKG, &msr)) in print_hwp()
4225 cpu, msr, in print_hwp()
4226 (unsigned int)(((msr) >> 0) & 0xff), in print_hwp()
4227 (unsigned int)(((msr) >> 8) & 0xff), in print_hwp()
4228 (unsigned int)(((msr) >> 16) & 0xff), in print_hwp()
4229 (unsigned int)(((msr) >> 24) & 0xff), (unsigned int)(((msr) >> 32) & 0xff3)); in print_hwp()
4232 if (get_msr(cpu, MSR_HWP_INTERRUPT, &msr)) in print_hwp()
4237 cpu, msr, ((msr) & 0x1) ? "EN" : "Dis", ((msr) & 0x2) ? "EN" : "Dis"); in print_hwp()
4239 if (get_msr(cpu, MSR_HWP_STATUS, &msr)) in print_hwp()
4244 cpu, msr, ((msr) & 0x1) ? "" : "No-", ((msr) & 0x2) ? "" : "No-"); in print_hwp()
4254 unsigned long long msr; in print_perf_limit() local
4269 get_msr(cpu, MSR_CORE_PERF_LIMIT_REASONS, &msr); in print_perf_limit()
4270 fprintf(outf, "cpu%d: MSR_CORE_PERF_LIMIT_REASONS, 0x%08llx", cpu, msr); in print_perf_limit()
4272 (msr & 1 << 15) ? "bit15, " : "", in print_perf_limit()
4273 (msr & 1 << 14) ? "bit14, " : "", in print_perf_limit()
4274 (msr & 1 << 13) ? "Transitions, " : "", in print_perf_limit()
4275 (msr & 1 << 12) ? "MultiCoreTurbo, " : "", in print_perf_limit()
4276 (msr & 1 << 11) ? "PkgPwrL2, " : "", in print_perf_limit()
4277 (msr & 1 << 10) ? "PkgPwrL1, " : "", in print_perf_limit()
4278 (msr & 1 << 9) ? "CorePwr, " : "", in print_perf_limit()
4279 (msr & 1 << 8) ? "Amps, " : "", in print_perf_limit()
4280 (msr & 1 << 6) ? "VR-Therm, " : "", in print_perf_limit()
4281 (msr & 1 << 5) ? "Auto-HWP, " : "", in print_perf_limit()
4282 (msr & 1 << 4) ? "Graphics, " : "", in print_perf_limit()
4283 (msr & 1 << 2) ? "bit2, " : "", in print_perf_limit()
4284 (msr & 1 << 1) ? "ThermStatus, " : "", (msr & 1 << 0) ? "PROCHOT, " : ""); in print_perf_limit()
4286 (msr & 1 << 31) ? "bit31, " : "", in print_perf_limit()
4287 (msr & 1 << 30) ? "bit30, " : "", in print_perf_limit()
4288 (msr & 1 << 29) ? "Transitions, " : "", in print_perf_limit()
4289 (msr & 1 << 28) ? "MultiCoreTurbo, " : "", in print_perf_limit()
4290 (msr & 1 << 27) ? "PkgPwrL2, " : "", in print_perf_limit()
4291 (msr & 1 << 26) ? "PkgPwrL1, " : "", in print_perf_limit()
4292 (msr & 1 << 25) ? "CorePwr, " : "", in print_perf_limit()
4293 (msr & 1 << 24) ? "Amps, " : "", in print_perf_limit()
4294 (msr & 1 << 22) ? "VR-Therm, " : "", in print_perf_limit()
4295 (msr & 1 << 21) ? "Auto-HWP, " : "", in print_perf_limit()
4296 (msr & 1 << 20) ? "Graphics, " : "", in print_perf_limit()
4297 (msr & 1 << 18) ? "bit18, " : "", in print_perf_limit()
4298 (msr & 1 << 17) ? "ThermStatus, " : "", (msr & 1 << 16) ? "PROCHOT, " : ""); in print_perf_limit()
4302 get_msr(cpu, MSR_GFX_PERF_LIMIT_REASONS, &msr); in print_perf_limit()
4303 fprintf(outf, "cpu%d: MSR_GFX_PERF_LIMIT_REASONS, 0x%08llx", cpu, msr); in print_perf_limit()
4305 (msr & 1 << 0) ? "PROCHOT, " : "", in print_perf_limit()
4306 (msr & 1 << 1) ? "ThermStatus, " : "", in print_perf_limit()
4307 (msr & 1 << 4) ? "Graphics, " : "", in print_perf_limit()
4308 (msr & 1 << 6) ? "VR-Therm, " : "", in print_perf_limit()
4309 (msr & 1 << 8) ? "Amps, " : "", in print_perf_limit()
4310 (msr & 1 << 9) ? "GFXPwr, " : "", in print_perf_limit()
4311 (msr & 1 << 10) ? "PkgPwrL1, " : "", (msr & 1 << 11) ? "PkgPwrL2, " : ""); in print_perf_limit()
4313 (msr & 1 << 16) ? "PROCHOT, " : "", in print_perf_limit()
4314 (msr & 1 << 17) ? "ThermStatus, " : "", in print_perf_limit()
4315 (msr & 1 << 20) ? "Graphics, " : "", in print_perf_limit()
4316 (msr & 1 << 22) ? "VR-Therm, " : "", in print_perf_limit()
4317 (msr & 1 << 24) ? "Amps, " : "", in print_perf_limit()
4318 (msr & 1 << 25) ? "GFXPwr, " : "", in print_perf_limit()
4319 (msr & 1 << 26) ? "PkgPwrL1, " : "", (msr & 1 << 27) ? "PkgPwrL2, " : ""); in print_perf_limit()
4322 get_msr(cpu, MSR_RING_PERF_LIMIT_REASONS, &msr); in print_perf_limit()
4323 fprintf(outf, "cpu%d: MSR_RING_PERF_LIMIT_REASONS, 0x%08llx", cpu, msr); in print_perf_limit()
4325 (msr & 1 << 0) ? "PROCHOT, " : "", in print_perf_limit()
4326 (msr & 1 << 1) ? "ThermStatus, " : "", in print_perf_limit()
4327 (msr & 1 << 6) ? "VR-Therm, " : "", in print_perf_limit()
4328 (msr & 1 << 8) ? "Amps, " : "", in print_perf_limit()
4329 (msr & 1 << 10) ? "PkgPwrL1, " : "", (msr & 1 << 11) ? "PkgPwrL2, " : ""); in print_perf_limit()
4331 (msr & 1 << 16) ? "PROCHOT, " : "", in print_perf_limit()
4332 (msr & 1 << 17) ? "ThermStatus, " : "", in print_perf_limit()
4333 (msr & 1 << 22) ? "VR-Therm, " : "", in print_perf_limit()
4334 (msr & 1 << 24) ? "Amps, " : "", in print_perf_limit()
4335 (msr & 1 << 26) ? "PkgPwrL1, " : "", (msr & 1 << 27) ? "PkgPwrL2, " : ""); in print_perf_limit()
4345 unsigned long long msr; in get_tdp_intel() local
4348 if (!get_msr(base_cpu, MSR_PKG_POWER_INFO, &msr)) in get_tdp_intel()
4349 return ((msr >> 0) & RAPL_POWER_GRANULARITY) * rapl_power_units; in get_tdp_intel()
4387 unsigned long long msr; in rapl_probe_intel() local
4531 if (get_msr(base_cpu, MSR_RAPL_POWER_UNIT, &msr)) in rapl_probe_intel()
4534 rapl_power_units = 1.0 / (1 << (msr & 0xF)); in rapl_probe_intel()
4536 rapl_energy_units = 1.0 * (1 << (msr >> 8 & 0x1F)) / 1000000; in rapl_probe_intel()
4538 rapl_energy_units = 1.0 / (1 << (msr >> 8 & 0x1F)); in rapl_probe_intel()
4542 time_unit = msr >> 16 & 0xF; in rapl_probe_intel()
4557 unsigned long long msr; in rapl_probe_amd() local
4580 if (get_msr(base_cpu, MSR_RAPL_PWR_UNIT, &msr)) in rapl_probe_amd()
4583 rapl_time_units = ldexp(1.0, -(msr >> 16 & 0xf)); in rapl_probe_amd()
4584 rapl_energy_units = ldexp(1.0, -(msr >> 8 & 0x1f)); in rapl_probe_amd()
4585 rapl_power_units = ldexp(1.0, -(msr & 0xf)); in rapl_probe_amd()
4642 unsigned long long msr; in print_thermal() local
4661 if (get_msr(cpu, MSR_IA32_PACKAGE_THERM_STATUS, &msr)) in print_thermal()
4664 dts = (msr >> 16) & 0x7F; in print_thermal()
4665 fprintf(outf, "cpu%d: MSR_IA32_PACKAGE_THERM_STATUS: 0x%08llx (%d C)\n", cpu, msr, tj_max - dts); in print_thermal()
4667 if (get_msr(cpu, MSR_IA32_PACKAGE_THERM_INTERRUPT, &msr)) in print_thermal()
4670 dts = (msr >> 16) & 0x7F; in print_thermal()
4671 dts2 = (msr >> 8) & 0x7F; in print_thermal()
4673 cpu, msr, tj_max - dts, tj_max - dts2); in print_thermal()
4679 if (get_msr(cpu, MSR_IA32_THERM_STATUS, &msr)) in print_thermal()
4682 dts = (msr >> 16) & 0x7F; in print_thermal()
4683 resolution = (msr >> 27) & 0xF; in print_thermal()
4685 cpu, msr, tj_max - dts, resolution); in print_thermal()
4687 if (get_msr(cpu, MSR_IA32_THERM_INTERRUPT, &msr)) in print_thermal()
4690 dts = (msr >> 16) & 0x7F; in print_thermal()
4691 dts2 = (msr >> 8) & 0x7F; in print_thermal()
4693 cpu, msr, tj_max - dts, tj_max - dts2); in print_thermal()
4699 void print_power_limit_msr(int cpu, unsigned long long msr, char *label) in print_power_limit_msr() argument
4703 ((msr >> 15) & 1) ? "EN" : "DIS", in print_power_limit_msr()
4704 ((msr >> 0) & 0x7FFF) * rapl_power_units, in print_power_limit_msr()
4705 (1.0 + (((msr >> 22) & 0x3) / 4.0)) * (1 << ((msr >> 17) & 0x1F)) * rapl_time_units, in print_power_limit_msr()
4706 (((msr >> 16) & 1) ? "EN" : "DIS")); in print_power_limit_msr()
4713 unsigned long long msr; in print_rapl() local
4732 if (get_msr(cpu, MSR_RAPL_PWR_UNIT, &msr)) in print_rapl()
4736 if (get_msr(cpu, MSR_RAPL_POWER_UNIT, &msr)) in print_rapl()
4740 fprintf(outf, "cpu%d: %s: 0x%08llx (%f Watts, %f Joules, %f sec.)\n", cpu, msr_name, msr, in print_rapl()
4745 if (get_msr(cpu, MSR_PKG_POWER_INFO, &msr)) in print_rapl()
4749 cpu, msr, in print_rapl()
4750 ((msr >> 0) & RAPL_POWER_GRANULARITY) * rapl_power_units, in print_rapl()
4751 ((msr >> 16) & RAPL_POWER_GRANULARITY) * rapl_power_units, in print_rapl()
4752 ((msr >> 32) & RAPL_POWER_GRANULARITY) * rapl_power_units, in print_rapl()
4753 ((msr >> 48) & RAPL_TIME_GRANULARITY) * rapl_time_units); in print_rapl()
4758 if (get_msr(cpu, MSR_PKG_POWER_LIMIT, &msr)) in print_rapl()
4762 cpu, msr, (msr >> 63) & 1 ? "" : "UN"); in print_rapl()
4764 print_power_limit_msr(cpu, msr, "PKG Limit #1"); in print_rapl()
4767 ((msr >> 47) & 1) ? "EN" : "DIS", in print_rapl()
4768 ((msr >> 32) & 0x7FFF) * rapl_power_units, in print_rapl()
4769 (1.0 + (((msr >> 54) & 0x3) / 4.0)) * (1 << ((msr >> 49) & 0x1F)) * rapl_time_units, in print_rapl()
4770 ((msr >> 48) & 1) ? "EN" : "DIS"); in print_rapl()
4774 if (get_msr(cpu, MSR_DRAM_POWER_INFO, &msr)) in print_rapl()
4778 cpu, msr, in print_rapl()
4779 ((msr >> 0) & RAPL_POWER_GRANULARITY) * rapl_power_units, in print_rapl()
4780 ((msr >> 16) & RAPL_POWER_GRANULARITY) * rapl_power_units, in print_rapl()
4781 ((msr >> 32) & RAPL_POWER_GRANULARITY) * rapl_power_units, in print_rapl()
4782 ((msr >> 48) & RAPL_TIME_GRANULARITY) * rapl_time_units); in print_rapl()
4785 if (get_msr(cpu, MSR_DRAM_POWER_LIMIT, &msr)) in print_rapl()
4788 cpu, msr, (msr >> 31) & 1 ? "" : "UN"); in print_rapl()
4790 print_power_limit_msr(cpu, msr, "DRAM Limit"); in print_rapl()
4793 if (get_msr(cpu, MSR_PP0_POLICY, &msr)) in print_rapl()
4796 fprintf(outf, "cpu%d: MSR_PP0_POLICY: %lld\n", cpu, msr & 0xF); in print_rapl()
4799 if (get_msr(cpu, MSR_PP0_POWER_LIMIT, &msr)) in print_rapl()
4802 cpu, msr, (msr >> 31) & 1 ? "" : "UN"); in print_rapl()
4803 print_power_limit_msr(cpu, msr, "Cores Limit"); in print_rapl()
4806 if (get_msr(cpu, MSR_PP1_POLICY, &msr)) in print_rapl()
4809 fprintf(outf, "cpu%d: MSR_PP1_POLICY: %lld\n", cpu, msr & 0xF); in print_rapl()
4811 if (get_msr(cpu, MSR_PP1_POWER_LIMIT, &msr)) in print_rapl()
4814 cpu, msr, (msr >> 31) & 1 ? "" : "UN"); in print_rapl()
4815 print_power_limit_msr(cpu, msr, "GFX Limit"); in print_rapl()
4958 unsigned long long msr = 3; in slm_bclk() local
4962 if (get_msr(base_cpu, MSR_FSB_FREQ, &msr)) in slm_bclk()
4965 i = msr & 0xf; in slm_bclk()
5024 unsigned long long msr; in set_temperature_target() local
5052 if (get_msr(base_cpu, MSR_IA32_TEMPERATURE_TARGET, &msr)) in set_temperature_target()
5055 tcc_default = (msr >> 16) & 0xFF; in set_temperature_target()
5060 tcc_offset = (msr >> 24) & 0xF; in set_temperature_target()
5062 cpu, msr, tcc_default - tcc_offset, tcc_default, tcc_offset); in set_temperature_target()
5065 tcc_offset = (msr >> 24) & 0x3F; in set_temperature_target()
5067 cpu, msr, tcc_default - tcc_offset, tcc_default, tcc_offset); in set_temperature_target()
5070 fprintf(outf, "cpu%d: MSR_IA32_TEMPERATURE_TARGET: 0x%08llx (%d C)\n", cpu, msr, tcc_default); in set_temperature_target()
5091 unsigned long long msr; in decode_feature_control_msr() local
5093 if (!get_msr(base_cpu, MSR_IA32_FEAT_CTL, &msr)) in decode_feature_control_msr()
5095 base_cpu, msr, msr & FEAT_CTL_LOCKED ? "" : "UN-", msr & (1 << 18) ? "SGX" : ""); in decode_feature_control_msr()
5100 unsigned long long msr; in decode_misc_enable_msr() local
5105 if (!get_msr(base_cpu, MSR_IA32_MISC_ENABLE, &msr)) in decode_misc_enable_msr()
5107 base_cpu, msr, in decode_misc_enable_msr()
5108 msr & MSR_IA32_MISC_ENABLE_TM1 ? "" : "No-", in decode_misc_enable_msr()
5109 msr & MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP ? "" : "No-", in decode_misc_enable_msr()
5110 msr & MSR_IA32_MISC_ENABLE_MWAIT ? "" : "No-", in decode_misc_enable_msr()
5111 msr & MSR_IA32_MISC_ENABLE_PREFETCH_DISABLE ? "No-" : "", in decode_misc_enable_msr()
5112 msr & MSR_IA32_MISC_ENABLE_TURBO_DISABLE ? "No-" : ""); in decode_misc_enable_msr()
5117 unsigned long long msr; in decode_misc_feature_control() local
5122 if (!get_msr(base_cpu, MSR_MISC_FEATURE_CONTROL, &msr)) in decode_misc_feature_control()
5125 base_cpu, msr, msr & (0 << 0) ? "No-" : "", msr & (1 << 0) ? "No-" : "", in decode_misc_feature_control()
5126 msr & (2 << 0) ? "No-" : "", msr & (3 << 0) ? "No-" : ""); in decode_misc_feature_control()
5138 unsigned long long msr; in decode_misc_pwr_mgmt_msr() local
5146 if (!get_msr(base_cpu, MSR_MISC_PWR_MGMT, &msr)) in decode_misc_pwr_mgmt_msr()
5148 base_cpu, msr, in decode_misc_pwr_mgmt_msr()
5149 msr & (1 << 0) ? "DIS" : "EN", msr & (1 << 1) ? "EN" : "DIS", msr & (1 << 8) ? "EN" : "DIS"); in decode_misc_pwr_mgmt_msr()
5160 unsigned long long msr; in decode_c6_demotion_policy_msr() local
5162 if (!get_msr(base_cpu, MSR_CC6_DEMOTION_POLICY_CONFIG, &msr)) in decode_c6_demotion_policy_msr()
5164 base_cpu, msr, msr & (1 << 0) ? "EN" : "DIS"); in decode_c6_demotion_policy_msr()
5166 if (!get_msr(base_cpu, MSR_MC6_DEMOTION_POLICY_CONFIG, &msr)) in decode_c6_demotion_policy_msr()
5168 base_cpu, msr, msr & (1 << 0) ? "EN" : "DIS"); in decode_c6_demotion_policy_msr()