tools/power/turbostat: Adjust cstate for has_snb_msrs() models
authorZhang Rui <rui.zhang@intel.com>
Fri, 8 Sep 2023 15:17:58 +0000 (23:17 +0800)
committerZhang Rui <rui.zhang@intel.com>
Wed, 27 Sep 2023 14:14:19 +0000 (22:14 +0800)
Enable PC7 for has_snb_msrs() models.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Reviewed-by: Len Brown <len.brown@intel.com>
tools/power/x86/turbostat/turbostat.c

index 2bfbf4ccf5acf26f20458f0ff68efbfa18401684..f3d44e81d7d51f5e590ac4a400ee1f16f537942b 100644 (file)
@@ -221,7 +221,6 @@ unsigned int rapl_joules;
 unsigned int summary_only;
 unsigned int list_header_only;
 unsigned int dump_only;
-unsigned int do_snb_cstates;
 unsigned int do_knl_cstates;
 unsigned int do_slm_cstates;
 unsigned int use_c1_residency_msr;
@@ -434,7 +433,7 @@ static const struct platform_features snb_features = {
        .has_msr_misc_pwr_mgmt = 1,
        .has_nhm_msrs = 1,
        .bclk_freq = BCLK_100MHZ,
-       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6,
+       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6 | PC7,
        .cst_limit = CST_LIMIT_SNB,
        .trl_msrs = TRL_BASE,
        .rapl_msrs = RAPL_PKG | RAPL_CORE_ALL | RAPL_GFX | RAPL_PKG_POWER_INFO,
@@ -445,7 +444,7 @@ static const struct platform_features snx_features = {
        .has_msr_misc_pwr_mgmt = 1,
        .has_nhm_msrs = 1,
        .bclk_freq = BCLK_100MHZ,
-       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6,
+       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6 | PC7,
        .cst_limit = CST_LIMIT_SNB,
        .trl_msrs = TRL_BASE,
        .rapl_msrs = RAPL_PKG_ALL | RAPL_CORE_ALL | RAPL_DRAM_ALL,
@@ -457,7 +456,7 @@ static const struct platform_features ivb_features = {
        .has_nhm_msrs = 1,
        .has_config_tdp = 1,
        .bclk_freq = BCLK_100MHZ,
-       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6,
+       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6 | PC7,
        .cst_limit = CST_LIMIT_SNB,
        .trl_msrs = TRL_BASE,
        .rapl_msrs = RAPL_PKG | RAPL_CORE_ALL | RAPL_GFX | RAPL_PKG_POWER_INFO,
@@ -468,7 +467,7 @@ static const struct platform_features ivx_features = {
        .has_msr_misc_pwr_mgmt = 1,
        .has_nhm_msrs = 1,
        .bclk_freq = BCLK_100MHZ,
-       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6,
+       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6 | PC7,
        .cst_limit = CST_LIMIT_SNB,
        .trl_msrs = TRL_BASE | TRL_LIMIT1,
        .rapl_msrs = RAPL_PKG_ALL | RAPL_CORE_ALL | RAPL_DRAM_ALL,
@@ -480,7 +479,7 @@ static const struct platform_features hsw_features = {
        .has_nhm_msrs = 1,
        .has_config_tdp = 1,
        .bclk_freq = BCLK_100MHZ,
-       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6,
+       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6 | PC7,
        .cst_limit = CST_LIMIT_HSW,
        .trl_msrs = TRL_BASE,
        .plr_msrs = PLR_CORE | PLR_GFX | PLR_RING,
@@ -493,7 +492,7 @@ static const struct platform_features hsx_features = {
        .has_nhm_msrs = 1,
        .has_config_tdp = 1,
        .bclk_freq = BCLK_100MHZ,
-       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6,
+       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6 | PC7,
        .cst_limit = CST_LIMIT_HSW,
        .trl_msrs = TRL_BASE | TRL_LIMIT1 | TRL_LIMIT2,
        .plr_msrs = PLR_CORE | PLR_RING,
@@ -507,7 +506,7 @@ static const struct platform_features hswl_features = {
        .has_nhm_msrs = 1,
        .has_config_tdp = 1,
        .bclk_freq = BCLK_100MHZ,
-       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6,
+       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6 | PC7,
        .cst_limit = CST_LIMIT_HSW,
        .trl_msrs = TRL_BASE,
        .plr_msrs = PLR_CORE | PLR_GFX | PLR_RING,
@@ -520,7 +519,7 @@ static const struct platform_features hswg_features = {
        .has_nhm_msrs = 1,
        .has_config_tdp = 1,
        .bclk_freq = BCLK_100MHZ,
-       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6,
+       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6 | PC7,
        .cst_limit = CST_LIMIT_HSW,
        .trl_msrs = TRL_BASE,
        .plr_msrs = PLR_CORE | PLR_GFX | PLR_RING,
@@ -533,7 +532,7 @@ static const struct platform_features bdw_features = {
        .has_nhm_msrs = 1,
        .has_config_tdp = 1,
        .bclk_freq = BCLK_100MHZ,
-       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6,
+       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6 | PC7,
        .cst_limit = CST_LIMIT_HSW,
        .trl_msrs = TRL_BASE,
        .rapl_msrs = RAPL_PKG | RAPL_CORE_ALL | RAPL_GFX | RAPL_PKG_POWER_INFO,
@@ -545,7 +544,7 @@ static const struct platform_features bdwg_features = {
        .has_nhm_msrs = 1,
        .has_config_tdp = 1,
        .bclk_freq = BCLK_100MHZ,
-       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6,
+       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6 | PC7,
        .cst_limit = CST_LIMIT_HSW,
        .trl_msrs = TRL_BASE,
        .rapl_msrs = RAPL_PKG | RAPL_CORE_ALL | RAPL_GFX | RAPL_PKG_POWER_INFO,
@@ -557,7 +556,7 @@ static const struct platform_features bdx_features = {
        .has_nhm_msrs = 1,
        .has_config_tdp = 1,
        .bclk_freq = BCLK_100MHZ,
-       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6,
+       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6 | PC7,
        .cst_limit = CST_LIMIT_HSW,
        .has_cst_auto_convension = 1,
        .trl_msrs = TRL_BASE,
@@ -572,7 +571,7 @@ static const struct platform_features skl_features = {
        .has_config_tdp = 1,
        .bclk_freq = BCLK_100MHZ,
        .crystal_freq = 24000000,
-       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6,
+       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6 | PC7,
        .cst_limit = CST_LIMIT_HSW,
        .trl_msrs = TRL_BASE,
        .tcc_offset_bits = 6,
@@ -586,7 +585,7 @@ static const struct platform_features cnl_features = {
        .has_nhm_msrs = 1,
        .has_config_tdp = 1,
        .bclk_freq = BCLK_100MHZ,
-       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6,
+       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6 | PC7,
        .cst_limit = CST_LIMIT_HSW,
        .trl_msrs = TRL_BASE,
        .tcc_offset_bits = 6,
@@ -600,7 +599,7 @@ static const struct platform_features skx_features = {
        .has_nhm_msrs = 1,
        .has_config_tdp = 1,
        .bclk_freq = BCLK_100MHZ,
-       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6,
+       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6 | PC7,
        .cst_limit = CST_LIMIT_SKX,
        .has_cst_auto_convension = 1,
        .trl_msrs = TRL_BASE | TRL_CORECOUNT,
@@ -614,7 +613,7 @@ static const struct platform_features icx_features = {
        .has_nhm_msrs = 1,
        .has_config_tdp = 1,
        .bclk_freq = BCLK_100MHZ,
-       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6,
+       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6 | PC7,
        .cst_limit = CST_LIMIT_ICX,
        .trl_msrs = TRL_BASE | TRL_CORECOUNT,
        .rapl_msrs = RAPL_PKG_ALL | RAPL_DRAM_ALL,
@@ -627,7 +626,7 @@ static const struct platform_features spr_features = {
        .has_nhm_msrs = 1,
        .has_config_tdp = 1,
        .bclk_freq = BCLK_100MHZ,
-       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6,
+       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6 | PC7,
        .cst_limit = CST_LIMIT_SKX,
        .trl_msrs = TRL_BASE | TRL_CORECOUNT,
        .rapl_msrs = RAPL_PKG_ALL | RAPL_DRAM_ALL,
@@ -668,7 +667,7 @@ static const struct platform_features gmt_features = {
        .has_nhm_msrs = 1,
        .bclk_freq = BCLK_100MHZ,
        .crystal_freq = 19200000,
-       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6,
+       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6 | PC7,
        .cst_limit = CST_LIMIT_GMT,
        .trl_msrs = TRL_BASE | TRL_CORECOUNT,
        .rapl_msrs = RAPL_PKG | RAPL_PKG_POWER_INFO,
@@ -679,7 +678,7 @@ static const struct platform_features gmtd_features = {
        .has_nhm_msrs = 1,
        .bclk_freq = BCLK_100MHZ,
        .crystal_freq = 25000000,
-       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6,
+       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6 | PC7,
        .cst_limit = CST_LIMIT_GMT,
        .trl_msrs = TRL_BASE | TRL_CORECOUNT,
        .rapl_msrs = RAPL_PKG_ALL | RAPL_DRAM_ALL | RAPL_CORE_ENERGY_STATUS,
@@ -690,7 +689,7 @@ static const struct platform_features gmtp_features = {
        .has_nhm_msrs = 1,
        .bclk_freq = BCLK_100MHZ,
        .crystal_freq = 19200000,
-       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6,
+       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6 | PC7,
        .cst_limit = CST_LIMIT_GMT,
        .trl_msrs = TRL_BASE,
        .rapl_msrs = RAPL_PKG | RAPL_PKG_POWER_INFO,
@@ -700,7 +699,7 @@ static const struct platform_features tmt_features = {
        .has_msr_misc_pwr_mgmt = 1,
        .has_nhm_msrs = 1,
        .bclk_freq = BCLK_100MHZ,
-       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6,
+       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6 | PC7,
        .cst_limit = CST_LIMIT_GMT,
        .trl_msrs = TRL_BASE,
        .rapl_msrs = RAPL_PKG_ALL | RAPL_CORE_ALL | RAPL_DRAM | RAPL_DRAM_PERF_STATUS | RAPL_GFX,
@@ -711,7 +710,7 @@ static const struct platform_features tmtd_features = {
        .has_msr_misc_pwr_mgmt = 1,
        .has_nhm_msrs = 1,
        .bclk_freq = BCLK_100MHZ,
-       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6,
+       .supported_cstates = CC1 | CC3 | CC6 | CC7 | PC2 | PC3 | PC6 | PC7,
        .cst_limit = CST_LIMIT_GMT,
        .trl_msrs = TRL_BASE | TRL_CORECOUNT,
        .rapl_msrs = RAPL_PKG_ALL,
@@ -5827,11 +5826,8 @@ void process_cpuid()
        if (platform->has_nhm_msrs)
                BIC_PRESENT(BIC_SMI);
        probe_bclk();
-       do_snb_cstates = has_snb_msrs(family, model);
 
        do_irtl_snb = has_snb_msrs(family, model);
-       if (do_snb_cstates && (pkg_cstate_limit >= PCL__7))
-               BIC_PRESENT(BIC_Pkgpc7);
        if (has_slv_msrs(family, model)) {
                BIC_NOT_PRESENT(BIC_Pkgpc2);
                BIC_NOT_PRESENT(BIC_Pkgpc3);