Commit Graph

1374 Commits

Author SHA1 Message Date
Mark Langsdorf 6431f27ce3 ACPICA: Update all copyrights/signons to 2023
JIRA: https://issues.redhat.com/browse/RHEL-26871

commit 612c29328466bdc1454ce76959fc03a1e2f7087a
Author: Bob Moore <robert.moore@intel.com>
Date: Thu, 06 Apr 2023 20:29:11 +0000

ACPICA commit 25bddd1824b1e450829468a64bbdcb38074ba3d2

Copyright updates to 2023.

Link: https://github.com/acpica/acpica/commit/25bddd18
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Mark Langsdorf <mlangsdo@redhat.com>
2024-03-27 11:39:39 -04:00
Scott Weaver 6d9c4e230f Merge: platform/x86: ISST: updates
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/3453

Description:
Updates for platform/x86: ISST
Updates for intel-speed-select to keep it in sync.

JIRA: https://issues.redhat.com/browse/RHEL-17865

Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=57368752

Tested: Did sanity boot testing on Intel GNR/SRF system.

Signed-off-by: Steve Best <sbest@redhat.com>

Approved-by: Tony Camuso <tcamuso@redhat.com>
Approved-by: David Arcari <darcari@redhat.com>

Signed-off-by: Scott Weaver <scweaver@redhat.com>
2024-01-09 10:42:39 -05:00
David Arcari 3bf3642e17 tools/power turbostat: version 2023.11.07
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit b8337e6a780dad9505f9d44da07c0a5c52fa0a04
Author: Len Brown <len.brown@intel.com>
Date:   Tue Nov 7 23:28:30 2023 -0500

    tools/power turbostat: version 2023.11.07

    Turbostat features are now table-driven (Rui Zhang)
    Add support for some new platforms (Sumeet Pawnikar, Rui Zhang)
    Gracefully run in configs when CPUs are limited (Rui Zhang, Srinivas Pandruvada)
    misc minor fixes.

    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:18 -05:00
David Arcari 863b96add0 tools/power/turbostat: bugfix "--show IPC"
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit f2c1dba31133233697fc96e808c6005fc304a8e9
Author: Len Brown <len.brown@intel.com>
Date:   Wed Jun 28 09:40:53 2023 -0400

    tools/power/turbostat: bugfix "--show IPC"

    turbostat --show IPC

    displays "inf" for the IPC column

    turbostat was missing the explicit dependency of IPC on APERF,
    and thus neglected to collect APERF when only IPC was requested.

    typcial use:

    turbostat --quiet --show CPU,IPC

    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:18 -05:00
David Arcari 749688f960 tools/power/turbostat: Add initial support for LunarLake
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 956dbd3de400a5665faf08a8588556db9c1bb56e
Author: Sumeet Pawnikar <sumeet.r.pawnikar@intel.com>
Date:   Tue May 23 17:46:45 2023 +0530

    tools/power/turbostat: Add initial support for LunarLake

    Add initial support for LunarLake platform.

    It shares the same features with CannonLake.

    Signed-off-by: Sumeet Pawnikar <sumeet.r.pawnikar@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:18 -05:00
David Arcari 815c14066f tools/power/turbostat: Add initial support for ArrowLake
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 7b57e7b683e3872b02117f46bd7dc7ad765888a8
Author: Sumeet Pawnikar <sumeet.r.pawnikar@intel.com>
Date:   Tue May 23 17:46:45 2023 +0530

    tools/power/turbostat: Add initial support for ArrowLake

    Add initial support for ArrowLake platform.

    It shares the same features with CannonLake.

    Signed-off-by: Sumeet Pawnikar <sumeet.r.pawnikar@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:18 -05:00
David Arcari dfcfb55a8b tools/power/turbostat: Add initial support for GrandRidge
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 5a6efcb9102af4210d5a59182dbfbc594ae50fd4
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Thu Oct 19 11:00:07 2023 +0800

    tools/power/turbostat: Add initial support for GrandRidge

    Add initial support for GrandRidge.

    It shares the same features as SierraForest, except that it does not
    support PC2/PC6.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:18 -05:00
David Arcari 0c3988ee22 tools/power/turbostat: Add initial support for SierraForest
JIRA: https://issues.redhat.com/browse/RHEL-20037

commit d33605f367414c7e0009978d1fbe9af01a36e221
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Thu Sep 28 13:09:02 2023 +0800

    tools/power/turbostat: Add initial support for SierraForest

    Add initial support for SierraForest.

    It shares the same features with SapphireRapids, except that it has
    MSR_MODULE_C6_RES_MS support.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:18 -05:00
David Arcari 906b87afb0 tools/power/turbostat: Add initial support for GraniteRapids
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 5feab4a6b8a730438a0fe8758dfa0700f951edde
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sat Sep 9 13:28:07 2023 +0800

    tools/power/turbostat: Add initial support for GraniteRapids

    Add initial support for GraniteRapids.

    It shares the same features with SapphireRapids.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:18 -05:00
David Arcari 771df3aff7 tools/power/turbostat: Add MSR_CORE_C1_RES support for spr_features
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 0e3f10e6aa97b0134b526ec9cdc3ccdac2239b43
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Thu Oct 19 11:04:33 2023 +0800

    tools/power/turbostat: Add MSR_CORE_C1_RES support for spr_features

    Add MSR_CORE_C1_RES support for spr_features because both Sapphirerapids
    and Emeraldrapids support this MSR.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:17 -05:00
David Arcari 74e0b99744 tools/power/turbostat: Move process to root cgroup
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 37f68a2940558b4f6f8e51b7b1d00f084b4bdde2
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Tue Jan 24 10:39:53 2023 -0800

    tools/power/turbostat: Move process to root cgroup

    When available CPUs are reduced via cgroup cpuset controller, turbostat
    will exit with errors (For example):
            get_counters: Could not migrate to CPU 0
            turbostat: re-initialized with num_cpus 20
            get_counters: Could not migrate to CPU 0
            turbostat: re-initialized with num_cpus 20

    Move the turbostat to root cgroup, which has every CPU.

    Writing the value 0 to a cgroup.procs file causes the writing
    process to be moved to the corresponding cgroup.

    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Tested-by: Zhang Rui <rui.zhang@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:17 -05:00
David Arcari 96d69095c3 tools/power/turbostat: Handle cgroup v2 cpu limitation
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit f638858da0925b29122f05135663013dc240eaf9
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Fri Oct 20 09:39:22 2023 +0800

    tools/power/turbostat: Handle cgroup v2 cpu limitation

    CPUs can be isolated via cgroup settings and turbostat should avoid
    migrating to these CPUs, just like it does for the '-c' cpus.

    Introduce cpu_effective_set to save the cgroup cpu limitation info from
    /sys/fs/cgroup/cpuset.cpus.effective. And use cpu_allowed_set as the
    intersection of cpu_present_set, cpu_effective_set and cpu_subset.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:17 -05:00
David Arcari acf42584e8 tools/power/turbostat: Abstrct function for parsing cpu string
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 8c3dd2c9e54273922ea71b2a4c0e77fc624c396b
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Fri Oct 20 09:45:21 2023 +0800

    tools/power/turbostat: Abstrct function for parsing cpu string

    Abstract parse_cpu_str() which can update any specified cpu_set by a
    given cpu string. This can be used to handle further CPU limitations
    from other sources like cgroup.

    The cpu string parsing code is also enhanced to handle the strings that
    have an extra '\n' before string terminator.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:17 -05:00
David Arcari d4f4710164 tools/power/turbostat: Handle offlined CPUs in cpu_subset
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit c25ef0e5d9d7d5fb9e1679286fc7a11e70f16c70
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Fri Oct 20 14:20:47 2023 +0800

    tools/power/turbostat: Handle offlined CPUs in cpu_subset

    It is possible that the cpu_subset contains offlined CPUs.

    If this happens during start, exit immediately because this is likely an
    operator error that is best fixed by re-invoking.
    If this happens at runtime, give a warning only because turbostat should
    do its best effort to continue running.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:17 -05:00
David Arcari f12ee37d4d tools/power/turbostat: Obey allowed CPUs for system summary
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 0fe3752901370b83b63d4ddbce708b23c8e41ea9
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Fri Oct 6 18:35:26 2023 +0800

    tools/power/turbostat: Obey allowed CPUs for system summary

    System summary should summarize the information for allowed CPUs instead
    of all the present CPUs.

    Introduce topology information for allowed CPUs, and use them to
    get system summary.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:17 -05:00
David Arcari 91313df2f4 tools/power/turbostat: Obey allowed CPUs for primary thread/core detection
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit ccf8a0528061b4ca5f5c0e73c8d888e7e6d8b054
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Fri Oct 6 09:59:14 2023 +0800

    tools/power/turbostat: Obey allowed CPUs for primary thread/core detection

    Thread_id doesn't tell if a CPU is allowed or not.

    Detect allowed CPUs only and use the first detected thread/core as the
    primary thread/core of a core/package.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:17 -05:00
David Arcari 576910ead0 tools/power/turbostat: Abstract several functions
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 74318add132365db3026e281ac06836a26cda857
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Wed Oct 4 15:13:23 2023 +0800

    tools/power/turbostat: Abstract several functions

    When detecting the primary thread/core in a core/package, current code
    doesn't handle the allowed CPUs.

    Abstract several functions for further fix of this issue.

    No functional change.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:17 -05:00
David Arcari 45b9e62989 tools/power/turbostat: Obey allowed CPUs during startup
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 7bb3fe27ad4f62039b2ac80a2147452a608b474f
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Wed Oct 4 14:25:25 2023 +0800

    tools/power/turbostat: Obey allowed CPUs during startup

    Set turbostat CPU affinity to make sure turbostat is running on one of
    the allowed CPUs.

    Set base_cpu to the first allowed CPU so that some platform information
    is dumped using one of the allowed CPUs.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:17 -05:00
David Arcari f1c60e0ada tools/power/turbostat: Obey allowed CPUs when accessing CPU counters
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 4ede6d1ce7acba9cafe7df4e935b174623cd2181
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Wed Oct 4 13:52:02 2023 +0800

    tools/power/turbostat: Obey allowed CPUs when accessing CPU counters

    for_all_cpus/for_all_cpus_2 are used for accessing the per CPU counters,
    and they should follow the cpu_allowed_set instead of cpu_present_set.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:17 -05:00
David Arcari 75e5206500 tools/power/turbostat: Introduce cpu_allowed_set
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 71cfd1da9f0635ccd7124ad8b67b9aed596be491
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Fri Oct 6 11:01:17 2023 +0800

    tools/power/turbostat: Introduce cpu_allowed_set

    Turbostat supports "-c" parameter which limits output to system summary
    plus the specified cpu-set. But some code still uses cpu_present_set to
    read and dump the counters.

    Introduce cpu_allowed_set for code that should obey the specified cpu-set.

    No functional change.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:17 -05:00
David Arcari a33ff439b8 tools/power/turbostat: Remove PC7/PC9 support on ADL/RPL
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 6b74a30b767e362eda7deeac52edcd546c5f6d8f
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sat Sep 9 13:26:51 2023 +0800

    tools/power/turbostat: Remove PC7/PC9 support on ADL/RPL

    Compared with other platforms that share cnl_features, ADL/RPL don't
    have PC7/PC9.

    Clone a new platform feature set from cnl_features for ADL/RPL, with
    PC7/PC9 removed.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:17 -05:00
David Arcari 6c46599bca tools/power/turbostat: Enable MSR_CORE_C1_RES on recent Intel client platforms
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 05ad96ff0fb9d1b16abb5022b9c62636c6780fc2
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sun Aug 27 15:33:27 2023 +0800

    tools/power/turbostat: Enable MSR_CORE_C1_RES on recent Intel client platforms

    All recent Intel client platforms have MSR_CORE_C1_RES. Enable the
    support on these platforms, including CNL/ICL/LKF/RKL/TGL/ADL/RPL/MTL.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:17 -05:00
David Arcari 6f11bf9faf tools/power/turbostat: Introduce probe_pm_features()
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 7ee39d8d593e3d28eced0fa1a8c8c6bdcbd4156e
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Wed Sep 13 23:32:39 2023 +0800

    tools/power/turbostat: Introduce probe_pm_features()

    Feature probe has nothing to do with CPUID, thus it should not be in
    process_cpuids().

    Introduce probe_pm_features() and move all feature probing functions
    into it.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:17 -05:00
David Arcari 2b1bec3b57 tools/power/turbostat: Relocate more probing related code
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 5612b2c89bd0a3a2f7c9e8756e6ead971b03f8a3
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Wed Aug 30 16:54:51 2023 +0800

    tools/power/turbostat: Relocate more probing related code

    Relocate more feature probing code outside of process_cpuids() into the
    corresponding probing functions.

    This improves the readability of code and the turbostat output.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:16 -05:00
David Arcari c9e2324a15 tools/power/turbostat: Reorder some functions
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit ce7a32c2a4cdba06ed5ead4ed8f980c893e20cd2
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Wed Aug 30 16:36:06 2023 +0800

    tools/power/turbostat: Reorder some functions

    Reorder some functions to solve code depdency introduced by next patch.

    No functional change.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:16 -05:00
David Arcari 6234860005 tools/power/turbostat: Relocate thermal probing code
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit db735f8ba78bf7692579b78f0ca1e40563ef79fd
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Thu Aug 31 16:02:16 2023 +0800

    tools/power/turbostat: Relocate thermal probing code

    Introduce probe_thermal(), and move all thermal probing related code
    into it.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:16 -05:00
David Arcari d308100870 tools/power/turbostat: Relocate lpi probing code
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit e7d7b82de192464b733fb2bcc9e305ea6f6ea47e
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Thu Aug 31 16:01:36 2023 +0800

    tools/power/turbostat: Relocate lpi probing code

    Introduce probe_lpi(), and move all lpi probing related code into it.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:16 -05:00
David Arcari e7256a0241 tools/power/turbostat: Relocate graphics probing code
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 2538d1673d02f66f6bdf01eebf36e271228778e9
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Thu Aug 31 16:01:12 2023 +0800

    tools/power/turbostat: Relocate graphics probing code

    Introduce probe_graphics(), and move all graphics probing related code
    into it.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:16 -05:00
David Arcari 896eba92ad tools/power/turbostat: Rename rapl probing function
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 6cb13609a07ba466b4613fdce7da8c98508069b7
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Thu Aug 31 16:00:33 2023 +0800

    tools/power/turbostat: Rename rapl probing function

    Rename rapl_probe() to probe_rapl() to be consistent with other probing
    function names.

    Probe rapl after probing uncore frequency.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:16 -05:00
David Arcari cbb3b93292 tools/power/turbostat: Rename uncore probing function
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 622c8f23556266a5afdd657aa0518b7d70d5dfc7
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Thu Aug 31 16:00:15 2023 +0800

    tools/power/turbostat: Rename uncore probing function

    Rename intel_uncore_frequency_probe() to probe_intel_uncore_frequency()
    to be consistent with other probing function names.

    Probe uncore frequency right after probing cstates.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:16 -05:00
David Arcari 22ae20a7d1 tools/power/turbostat: Relocate pstate probing code
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 11cd9a09f3e827605cf8fc7c343ddb8c9f4ee95d
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Thu Aug 31 15:58:10 2023 +0800

    tools/power/turbostat: Relocate pstate probing code

    Introduce probe_pstates() and move all pstate probing related code into
    it.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:16 -05:00
David Arcari 3081ee4c3a tools/power/turbostat: Relocate cstate probing code
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 045acf6064c5567011163e97c28906e0a7791414
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Tue Aug 29 13:47:58 2023 +0800

    tools/power/turbostat: Relocate cstate probing code

    Move all cstate probing related code into probe_cstates().

    Note that dump_platform_info() actually dumps both MSR_PLATFORM_INFO and
    MSR_IA32_POWER_CTL. MSR_PLATFORM_INFO is for pstate and
    MSR_IA32_POWER_CTL is for cstate. So split dump_platform_info() and dump
    MSR_IA32_POWER_CTL in probe_cstates().

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:16 -05:00
David Arcari e62e133c1d tools/power/turbostat: Improve probe_platform_features() logic
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 32e8c6169af7ef7c938b1bd996d27ab171e27d80
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Thu Aug 31 14:44:06 2023 +0800

    tools/power/turbostat: Improve probe_platform_features() logic

    AMD/Hygon platforms that don't have RAPL use 'amd_features' to describe
    the platform features. Unknown Intel platforms use 'default_features' to
    describe the platform features.

    As none of the platform feature is set for 'amd_features' or
    'default_features', there is no need to maintain both of them.

    Remove 'amd_features' structure and improve the logic in
    probe_platform_features().

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:16 -05:00
David Arcari 682c5e1326 tools/power/turbostat: Delete intel_model_duplicates()
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit d085b3b0f11af7d23601b832e0d9e446d18df968
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sun Aug 27 21:53:21 2023 +0800

    tools/power/turbostat: Delete intel_model_duplicates()

    Now CPU model checks have been cleaned up, no code depends on the
    duplicated CPU model value.

    Delete intel_model_duplicates().

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:16 -05:00
David Arcari f833ca740c tools/power/turbostat: Abstract cstate prewake bit support
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 7d0ebe6f7eaf8c0ac069ddab1fe3793401139fb3
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Thu Aug 31 15:57:44 2023 +0800

    tools/power/turbostat: Abstract cstate prewake bit support

    Abstract cstate prewake bit support.

    Delete is_icx()/is_spr() CPU model checks.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:16 -05:00
David Arcari 21c0ee167f tools/power/turbostat: Abstract aperf/mperf multiplier support
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit ed43247b15a4fb4df01c3408fcab6e206f93ab87
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Thu Aug 31 15:49:10 2023 +0800

    tools/power/turbostat: Abstract aperf/mperf multiplier support

    Abstract aperf/mperf multiplier support.

    Delete is_knl() CPU model check.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:16 -05:00
David Arcari a3b00fcfb0 tools/power/turbostat: Abstract extended cstate MSRs support
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 58ddb691d8d8a281535406766da4e23e0f011126
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sun Aug 27 15:07:43 2023 +0800

    tools/power/turbostat: Abstract extended cstate MSRs support

    Abstract the support for MSR_PKG_WEIGHTED_CORE_C0_RES,
    MSR_PKG_ANY_CORE_C0_RES, MSR_PKG_ANY_GFXE_C0_RES and
    MSR_PKG_BOTH_CORE_GFXE_C0_RES.

    Delete has_skl_msrs() CPU model check.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:16 -05:00
David Arcari 715b556ac9 tools/power/turbostat: Abstract MSR_KNL_CORE_C6_RESIDENCY support
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 80d132cb45f2cc171395bfaacd74567a183ab160
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sun Aug 27 15:00:58 2023 +0800

    tools/power/turbostat: Abstract MSR_KNL_CORE_C6_RESIDENCY support

    Abstract the support for MSR_KNL_CORE_C6_RESIDENCY.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:15 -05:00
David Arcari 55e946d2e9 tools/power/turbostat: Abstract MSR_ATOM_PKG_C6_RESIDENCY support
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit c8202a6c3acf7bbde42b5e389eec40fd8e1b8358
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sun Aug 27 15:26:14 2023 +0800

    tools/power/turbostat: Abstract MSR_ATOM_PKG_C6_RESIDENCY support

    Abstract the support for MSR_ATOM_PKG_C6_RESIDENCY.

    Delete is_slm() CPU model check.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:15 -05:00
David Arcari b6cf24da66 tools/power/turbostat: Abstract MSR_CC6/MC6_DEMOTION_POLICY_CONFIG support
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 6c36882e09dbc9a44d64180ba7972838d3f45488
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sun Aug 27 14:52:24 2023 +0800

    tools/power/turbostat: Abstract MSR_CC6/MC6_DEMOTION_POLICY_CONFIG support

    Abstract the support for MSR_CC6/MC6_DEMOTION_POLICY_CONFIG.

    Delete has_slv_msrs() CPU model check.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:15 -05:00
David Arcari f9cc99fd93 tools/power/turbostat: Abstract MSR_MODULE_C6_RES_MS support
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 9cc1c1038526a5b6c9a57397def80ba79c260ff2
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sun Aug 27 14:47:30 2023 +0800

    tools/power/turbostat: Abstract MSR_MODULE_C6_RES_MS support

    Abstract MSR_MODULE_C6_RES_MS support.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:15 -05:00
David Arcari b362e234c7 tools/power/turbostat: Abstract MSR_CORE_C1_RES support
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 76d83d2ae8e3099d9a6bd67fba918108824d7d4d
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sun Aug 27 14:41:30 2023 +0800

    tools/power/turbostat: Abstract MSR_CORE_C1_RES support

    Abstract the support for MSR_CORE_C1_RES.

    Delete is_dnv() CPU model check.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:15 -05:00
David Arcari e715627ecd tools/power/turbostat: Abstract IRTL support
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 148df4fd04a98fb24198ecb4419c87e07d38af30
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Fri Sep 8 23:18:51 2023 +0800

    tools/power/turbostat: Abstract IRTL support

    Abstract the support for MSR_PKGC3/PKGC6/PKGC7/PKGC8/PKGC9/PKGC10_IRTL.

    Delete has_snb_msrs() CPU model check.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:15 -05:00
David Arcari 3db02c9f0f tools/power/turbostat: Use fine grained IRTL output
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 8c382f9e74663072805565036026d4e79de96425
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sun Aug 27 14:27:26 2023 +0800

    tools/power/turbostat: Use fine grained IRTL output

    It is pointless to dump the IRTL register for a package cstate that is
    not supported by the platform.

    Print IRTL only for states that are available in
    platform->supported_cstates.

    Delete has_c8910_msrs() CPU model check.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:15 -05:00
David Arcari 31e72609a1 tools/power/turbostat: Adjust cstate for is_slm()/is_knl()/is_cnl()/is_ehl() models
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit cd7a2b6a61100a0fe8a40916d1afbd72d8833d57
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sun Aug 27 14:24:19 2023 +0800

    tools/power/turbostat: Adjust cstate for is_slm()/is_knl()/is_cnl()/is_ehl() models

    Disable CC3 for is_slm()/is_knl()/is_cnl()/is_ehl() models.

    Delete is_cnl()/is_ehl() CPU model checks.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:15 -05:00
David Arcari 534a2b5fbe tools/power/turbostat: Adjust cstate for has_c8910_msrs() models
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 4d2c95d40a90877ffd8f961055419f1f550a7ed9
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sun Aug 27 14:20:02 2023 +0800

    tools/power/turbostat: Adjust cstate for has_c8910_msrs() models

    Enable PC8/PC9/PC10 for has_c8910_msrs() models.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:15 -05:00
David Arcari 4fa88f54e2 tools/power/turbostat: Adjust cstate for is_bdx() models
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 1109694817fb4fcdfccb1a86fd58e69fb60f4eab
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sun Aug 27 14:16:52 2023 +0800

    tools/power/turbostat: Adjust cstate for is_bdx() models

    Disable CC7/PC7 for is_bdx() models.

    Delete is_bdx() CPU model check.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:15 -05:00
David Arcari be62b08ef8 tools/power/turbostat: Adjust cstate for is_skx()/is_icx()/is_spr() models
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 24d16bec379db6eea2d72e18c97c6c80e486a5e1
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Fri Sep 8 23:18:27 2023 +0800

    tools/power/turbostat: Adjust cstate for is_skx()/is_icx()/is_spr() models

    Disable CC3/CC7/PC3/PC7 for is_skx()/is_icx()/is_spr() models.

    Delete is_skx() CPU model check.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:15 -05:00
David Arcari e746d1eff5 tools/power/turbostat: Adjust cstate for is_dnv() models
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 8e20ced057423f0edaf40b650facc221e8030b33
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sun Aug 27 14:12:29 2023 +0800

    tools/power/turbostat: Adjust cstate for is_dnv() models

    Enable CC1 and disable CC3/CC7/PC3/PC7 for is_dnv() models.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:15 -05:00
David Arcari 99368deef5 tools/power/turbostat: Adjust cstate for is_jvl() models
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 3d982ac0dafeab860b9d42f5cc41a78753275fdd
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sun Aug 27 14:09:20 2023 +0800

    tools/power/turbostat: Adjust cstate for is_jvl() models

    Disable CC3/CC7/PC2/PC3/PC6/PC7 for is_jvl() models.

    Delete is_jvl() CPU model check.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:15 -05:00
David Arcari 9ab8cb1dc8 tools/power/turbostat: Adjust cstate for has_slv_msrs() models
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit ff206149551f09117f44883650a45ae692745703
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sun Aug 27 14:07:08 2023 +0800

    tools/power/turbostat: Adjust cstate for has_slv_msrs() models

    Disable PC2/PC3/PC7 and enable PC6 for has_slv_msrs() models.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:15 -05:00
David Arcari e12518c773 tools/power/turbostat: Adjust cstate for has_snb_msrs() models
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 192cbf0468ae31062526287e257f5b56214d2da5
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Fri Sep 8 23:17:58 2023 +0800

    tools/power/turbostat: Adjust cstate for has_snb_msrs() models

    Enable PC7 for has_snb_msrs() models.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:14 -05:00
David Arcari b4348b9a3b tools/power/turbostat: Adjust cstate for models with .cst_limit set
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 6f1935c036f79b56b6a1dc6e51c8c6fe483983ec
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Fri Sep 8 23:17:23 2023 +0800

    tools/power/turbostat: Adjust cstate for models with .cst_limit set

    Enable PC3/PC6 for platforms with .cst_limit set because package cstates
    are guarded by pkg_cstate_limit.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:14 -05:00
David Arcari d1d9c8a072 tools/power/turbostat: Adjust cstate for has_snb_msrs() models
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 942c854d8d0f6c6fc0864a9da5f5e374a8e146e5
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Fri Sep 8 23:16:56 2023 +0800

    tools/power/turbostat: Adjust cstate for has_snb_msrs() models

    Enable CC7 and PC2 for has_snb_msrs() models.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:14 -05:00
David Arcari 2980218f0e tools/power/turbostat: Adjust cstate for models with .has_nhm_msrs set
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit ce7ddf8af2f96a8a7af4cc2273843518c5810166
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Fri Sep 8 23:16:27 2023 +0800

    tools/power/turbostat: Adjust cstate for models with .has_nhm_msrs set

    Enable CC1/CC3/CC6 for platforms with .has_nhm_msrs set.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:14 -05:00
David Arcari be5b275ffb tools/power/turbostat: Add skeleton support for cstate enumeration
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 3c6a17b8ae44b0116e303402803c173fe2a3da92
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sun Aug 27 22:37:37 2023 +0800

    tools/power/turbostat: Add skeleton support for cstate enumeration

    Add skeleton support for cstate enumeration.

    Note that the previous logic may override the cstate setting for
    multiple times for different reasons. The conversion to new cstate
    enumeration must be done step by step following the previous code
    order strictly.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:14 -05:00
David Arcari af4e0793d2 tools/power/turbostat: Abstract TSC tweak support
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 485a017c45200ed82518f6cdeea554f77e9a0562
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sun Aug 27 10:37:23 2023 +0800

    tools/power/turbostat: Abstract TSC tweak support

    On some models, the CPU base frequency is different from the TSC
    frequency, and the aperf/mperf counters are running at CPU base
    frequency instead of TSC frequency.

    Abstract support for TSC tweak.

    Given that tsc_tweak depends on base_hz, move the code to probe_bclk()
    after base_hz is available.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:14 -05:00
David Arcari 0fe71fdb5d tools/power/turbostat: Remove unused family/model parameters for RAPL functions
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit bf1ad57c3f92c551dbfdcecd49797253f55cb7c1
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sun Aug 27 10:28:04 2023 +0800

    tools/power/turbostat: Remove unused family/model parameters for RAPL functions

    RAPL probing can be done without family/model checking. Remove these
    parameters in rapl probe functions.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:14 -05:00
David Arcari 9e3204fc7f tools/power/turbostat: Abstract hardcoded TDP value
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 7c60409382a4be05d601e0b45db7b0166845b0cf
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sun Aug 27 10:21:10 2023 +0800

    tools/power/turbostat: Abstract hardcoded TDP value

    Different hardcoded TDP values are used when TDP can not be retrieved
    from the hardware.

    Abstract hardcoded TDP value.

    Delete CPU model checks in get_tdp_intel().

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:14 -05:00
David Arcari 079e1da5ed tools/power/turbostat: Abstract fixed DRAM Energy unit support
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 9e6f35159cdef148c711d2fb7d5fd2b2b6fb772d
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sat Apr 22 12:21:58 2023 +0800

    tools/power/turbostat: Abstract fixed DRAM Energy unit support

    Abstract the support for fixed Dram domain energy unit.

    Delete rapl_dram_energy_units_probe() CPU model check.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:14 -05:00
David Arcari ab9bd28509 tools/power/turbostat: Abstract RAPL divisor support
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 6d35b8c4a661c849361239fe316035ea952606a3
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sat Apr 22 11:59:04 2023 +0800

    tools/power/turbostat: Abstract RAPL divisor support

    INTEL_FAM6_ATOM_SILVERMONT model needs a divisor to convert the raw
    Energy Units value from MSR_RAPL_POWER_UNIT.

    Abstract the support for RAPL divisor.

    Delete CPU model check in rapl_probe_intel().

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:14 -05:00
David Arcari 3c7fe6a206 tools/power/turbostat: Abstract Per Core RAPL support
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit e338831b14d2da921348c8c4055b9f2c94effe73
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sun Aug 27 21:37:46 2023 +0800

    tools/power/turbostat: Abstract Per Core RAPL support

    Abstract the support for Per Core RAPL.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:14 -05:00
David Arcari b6bd4eb83f tools/power/turbostat: Abstract RAPL MSRs support
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 86ba263d9b72b7766a99059e9b3bd104d089b7fa
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Mon Aug 28 15:09:40 2023 +0800

    tools/power/turbostat: Abstract RAPL MSRs support

    Abstract the support for RAPL MSRs.

    Delete CPU model checks in rapl_probe_intel().

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:14 -05:00
David Arcari 3c51365a96 tools/power/turbostat: Simplify the logic for RAPL enumeration
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit a98f886035d5f7e0ec66036dd6bf98b40e75b692
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sat Aug 26 14:57:12 2023 +0800

    tools/power/turbostat: Simplify the logic for RAPL enumeration

    The support for each RAPL domains, as well as the support for the perf
    status of each RAPL domains, can be detected by checking the
    availabilities of the corresponding RAPL MSRs.

    Change the code accordingly and remove the hardcoded logic for each
    model.

    Note that this also fixes the INTEL_FAM6_ATOM_TREMONT model, which has
    RAPL_PKG_PERF_STATUS and MSR_DRAM_PERF_STATUS but doesn't have BIC_PKG__
    and BIC_RAM__ set.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:14 -05:00
David Arcari 27bfab004b tools/power/turbostat: Redefine RAPL macros
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit b9cd66833d3a651cea10666674e9abcf2182e8ad
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sat Aug 26 14:38:38 2023 +0800

    tools/power/turbostat: Redefine RAPL macros

    Redefine RAPL macros to make the code more readable.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:14 -05:00
David Arcari f2d817facd tools/power/turbostat: Abstract hardcoded Crystal Clock frequency
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit a5d1ab93a0993616efbf61378e491d6673f4684d
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sat Apr 22 11:39:49 2023 +0800

    tools/power/turbostat: Abstract hardcoded Crystal Clock frequency

    Abstract the support for hardcoded Crystal Clock frequency, which is
    used when crystal clock is not available from CPUID.15.

    Delete CPU model checks in process_cpuid().

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:13 -05:00
David Arcari b08ff5bf12 tools/power/turbostat: Abstract Automatic Cstate Conversion support
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit d90120bf9f111bec8ba0b8ef86c46ccbcd9df188
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sat Apr 22 11:29:18 2023 +0800

    tools/power/turbostat: Abstract Automatic Cstate Conversion support

    Abstract the support for AUTOMATIC_CSTATE_CONVERSION bit in
    MSR_PKG_CST_CONFIG_CONTROL.

    Delete automatic_cstate_conversion_probe() CPU model check.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:13 -05:00
David Arcari 18cece369d tools/power/turbostat: Abstract Perf Limit Reasons MSRs support
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 0c057cf7a0e163bf9631b83c002b3a55691674c7
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sun Jul 30 14:25:17 2023 +0800

    tools/power/turbostat: Abstract Perf Limit Reasons MSRs support

    Abstract the support for MSR_CORE/GFX/RING_PERF_LIMIT_REASONS MSRs.

    Delete perf_limit_reasons_probe() CPU model check.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:13 -05:00
David Arcari fa17a5b854 tools/power/turbostat: Abstract TCC Offset bits support
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit d8e1623baa0b49aa90cf5801cfaac9e3d3aa1e19
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Fri Aug 25 23:04:44 2023 +0800

    tools/power/turbostat: Abstract TCC Offset bits support

    Abstract the support for different TCC Offset bits in
    MSR_IA32_TEMPERATURE_TARGET.

    Delete check_tcc_offset() CPU model check.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:13 -05:00
David Arcari 2ef39977d1 tools/power/turbostat: Abstract Config TDP MSRs support
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit a61c9cb478c0bf31a50d1829834e822e92876c95
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Thu Aug 31 14:19:46 2023 +0800

    tools/power/turbostat: Abstract Config TDP MSRs support

    Abstract the support for MSR_CONFIG_TDP_NOMINAL/LEVEL_1/LEVEL_2/CONTROL
    and MSR_TURBO_ACTIVATION_RATIO.

    Delete has_config_tdp() CPU model check.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:13 -05:00
David Arcari 76d73b9d4c tools/power/turbostat: Rename some TRL functions
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit a3943deaf98f713c819dd7e67af734d4ed4da030
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sun Jul 30 13:54:25 2023 +0800

    tools/power/turbostat: Rename some TRL functions

    Rename dump_hsw_turbo_ratio_limits() and dump_ivt_turbo_ratio_limits()
    to dump_turbo_ratio_limit2() and dump_turbo_ratio_limit1() because they
    dump MSR_TURBO_RATIO_LIMIT1/LIMIT2, and the MSRs' behavior is
    consistent when they are available.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:13 -05:00
David Arcari 32110a8ac8 tools/power/turbostat: Abstract Turbo Ratio Limit MSRs support
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 10d85d85ab4f3ae7faca4450ce7b0a166fd396f0
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Fri Sep 8 23:16:00 2023 +0800

    tools/power/turbostat: Abstract Turbo Ratio Limit MSRs support

    Abstract the support for MSR_TURBO_RATIO_LIMIT, MSR_TRUBO_RATIO_LIMIT1,
    MSR_TURBO_RATIO_LIMIT2, MSR_SECONDARY_TURBO_RATIO_LIMIT,
    MSR_ATOM_CORE_RATIOS and MSR_ATOM_CORE_TURBO_RATIOS.

    Delete has_turbo_ratio_group_limits(), has_turbo_ratio_limit(),
    has_atom_turbo_ratio_limit(), has_ivt_turbo_ratio_limit(),
    has_hsw_turbo_ratio_limit(), has_knl_turbo_ratio_limit() and
    has_glm_turbo_ratio_limit() CPU model checks.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:13 -05:00
David Arcari cbce5b06e4 tools/power/turbostat: Rename some functions
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 8b7199c0855e3b22532a21aaaed78e699431e4e5
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Mon Mar 27 14:58:35 2023 +0800

    tools/power/turbostat: Rename some functions

    Rename dump_nhm_platform_info() and dump_nhm_cst_cfg() to
    dump_platform_info() and dump_cst_cfg() because these MSRs' behavior is
    consistent when they're available.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:13 -05:00
David Arcari eaa75c9290 tools/power/turbostat: Remove a redundant check
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit c2c25e85df316a624e4a8ee85d65ea29265f486d
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Mon Mar 27 14:57:06 2023 +0800

    tools/power/turbostat: Remove a redundant check

    Platforms with has_msr_misc_pwr_mgmt set is a subset of platforms with
    has_nhm_msrs set.

    Thus remove the redudant check for platform->has_nhm_msrs.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:13 -05:00
David Arcari 6967b1021d tools/power/turbostat: Abstract Nehalem MSRs support
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit fcfa1ce074ab76272639961d4d7900b91657a8d5
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Fri Aug 25 16:52:23 2023 +0800

    tools/power/turbostat: Abstract Nehalem MSRs support

    MSR_PLATFORM_INFO, MSR_IA32_TEMPERATURE_TARGET, MSR_SMI_COUNT,
    MSR_PKG_CST_CONFIG_CONTROL, and the TRL MSRs are always available for
    platforms since Nehalem. Support for these msrs can be described
    altogether.

    Abstract the support for these MSRs.

    Delete probe_nhm_msrs() CPU model check.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:13 -05:00
David Arcari 1220b15d0e tools/power/turbostat: Abstract Package cstate limit decoding support
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 3989fc890782c8002477895e9f24ffb98a132293
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sun Aug 27 22:37:06 2023 +0800

    tools/power/turbostat: Abstract Package cstate limit decoding support

    Abstract the support for decoding package cstate limit from
    MSR_PKG_CST_CONFIG_CONTROL.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:13 -05:00
David Arcari 036fed1d31 tools/power/turbostat: Abstract BCLK frequency support
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 71e841293c715797d8c6ae8cdc3f74b4396c5570
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Mon Aug 21 22:22:48 2023 +0800

    tools/power/turbostat: Abstract BCLK frequency support

    Abstract CPU base clock frequency support.

    Note that bclk is used by
    1. calculate base_hz using MSR_PLATFORM_INFO, which is guarded by
       probe_nhm_msrs().
    2. dump MSR_PLATFORM_INFO and Turbo Ratio Limit MSRs, which are also
       guarded by probe_nhm_msrs().
    Thus probe_bclk() works for probe_nhm_msrs() models only.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:13 -05:00
David Arcari e42acefe83 tools/power/turbostat: Abstract MSR_MISC_PWR_MGMT support
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 3dd0e7547d11e770bafb40ad41f2631cc4b16649
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Mon Aug 21 22:12:57 2023 +0800

    tools/power/turbostat: Abstract MSR_MISC_PWR_MGMT support

    Abstract MSR_MISC_PWR_MGMT support.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:13 -05:00
David Arcari 82c2519c7a tools/power/turbostat: Abstract MSR_MISC_FEATURE_CONTROL support
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 778fc34a7a3db2811e28ce570318dd047f278cb2
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Mon Aug 21 15:26:32 2023 +0800

    tools/power/turbostat: Abstract MSR_MISC_FEATURE_CONTROL support

    Abstract MSR_MISC_FEATURE_CONTROL support.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:13 -05:00
David Arcari da2b9f7e8c tools/power/turbostat: Add skeleton support for table driven feature enumeration
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 45232ab168a3c5abad86eafaef2beed8d7037666
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sun Aug 27 21:52:53 2023 +0800

    tools/power/turbostat: Add skeleton support for table driven feature enumeration

    Turbostat supports a series of features that may diverge among different
    CPU models.

    Current code uses various of CPU model checks in different places to
    handle this, which makes the code hard to maintain.

    Add skeleton support for table driven feature enumeration to replace the
    current error-prone CPU model checks and global variables.

    Note: by comparing the CPU models with intel-family.h, it is found that
    turbostat support for below four Models are missing, including
    INTEL_FAM6_ICELAKE, INTEL_FAM6_ATOM_SILVERMONT_MID,
    INTEL_FAM6_ATOM_AIRMONT_MID and INTEL_FAM6_ATOM_AIRMONT_NP. Adding
    support for these models is a different work, thus it is not covered in
    this patch set.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:12 -05:00
David Arcari aa7f703404 tools/power/turbostat: Remove pseudo check for two models
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 48674c1bb6124fe392e8fed80a39fcb3f62e6551
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Mon Mar 27 12:36:55 2023 +0800

    tools/power/turbostat: Remove pseudo check for two models

    INTEL_FAM6_ATOM_SILVERMONT_MID/INTEL_FAM6_ATOM_AIRMONT_MID are not
    listed in probe_nhm_msrs(). This means that most of the turbostat
    features are not available on these two platforms.

    Further more, checking for these two models in has_slv_msrs() is
    dead code. Because has_slv_msrs() is called by the code guarded by
    probe_nhm_msrs().

    For these two reasons, remove pseudo check for
    INTEL_FAM6_ATOM_SILVERMONT_MID and INTEL_FAM6_ATOM_AIRMONT_MID.

    Will add back the support when we can access these two platforms.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:12 -05:00
David Arcari a0b640c737 tools/power/turbostat: Remove redundant duplicates
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit bbfc33b1e49f443296e56d8b76c77373f700aedc
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Fri Mar 24 16:27:30 2023 +0800

    tools/power/turbostat: Remove redundant duplicates

    Remove redundant duplicates in intel_model_duplicates().

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:12 -05:00
David Arcari d68600fa2e tools/power/turbostat: Replace raw value cpu model with Macro
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 6d306d6ec7e0f9a5e90f5afd70e3b6c32ae50ce6
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Fri Mar 24 16:26:25 2023 +0800

    tools/power/turbostat: Replace raw value cpu model with Macro

    Kernel already has
     #define INTEL_FAM6_NEHALEM_G   0x1F /* Auburndale / Havendale */

    Use standard Macro for CPU Model instead of raw value.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:12 -05:00
David Arcari 4c41cb483d tools/power/turbostat: Support alternative graphics sysfs knobs
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 2c019d657968bdd93e11615e0919d8181a54742d
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sun Aug 21 22:39:16 2022 +0800

    tools/power/turbostat: Support alternative graphics sysfs knobs

    /sys/class/graphics/fb0/device/drm/card0/ and /sys/class/drm/card0/
    point to the same device node.
    But in some cases, one exists and the other one does not.

    Prefer to use /sys/class/drm/card0/, and fall back to
    /sys/class/graphics/fb0/device/drm/card0/.

    This recovers the "GFXMHz" and "GFXAMHz" columns on some platforms like
    a SPR server.

    Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:12 -05:00
David Arcari 5af7f1ad12 tools/power/turbostat: Enable TCC Offset on more models
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit b98a6d78768ec459d394db8bc086d071eb6556c8
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Fri Mar 24 16:30:55 2023 +0800

    tools/power/turbostat: Enable TCC Offset on more models

    All Models that duplicate INTEL_FAM6_CANNONLAKE_L support TCC Offset.
    Enable this feature on all these models.

    Delete obsolete model_orig.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:12 -05:00
David Arcari b87f333221 tools/power/turbostat: Enable the C-state Pre-wake printing
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit b61b7d8c4c22c4298a50ae5d0ee88facb85ce665
Author: Chen Yu <yu.c.chen@intel.com>
Date:   Mon Mar 27 11:17:44 2023 +0800

    tools/power/turbostat: Enable the C-state Pre-wake printing

    Currently the C-state Pre-wake will not be printed due to the
    probe has not been invoked. Invoke the probe function accordingly.

    Fixes: aeb01e6d71 ("tools/power turbostat: Print the C-state Pre-wake settings")
    Signed-off-by: Chen Yu <yu.c.chen@intel.com>
    Reviewed-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:12 -05:00
David Arcari 120d887908 tools/power/turbostat: Fix a knl bug
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 137f01b3529d292a68d22e9681e2f903c768f790
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sat Mar 25 21:57:07 2023 +0800

    tools/power/turbostat: Fix a knl bug

    MSR_KNL_CORE_C6_RESIDENCY should be evaluated only if
    1. this is KNL platform
    AND
    2. need to get C6 residency or need to calculate C1 residency

    Fix the broken logic introduced by commit 1e9042b9c8 ("tools/power
    turbostat: Fix CPU%C1 display value").

    Fixes: 1e9042b9c8 ("tools/power turbostat: Fix CPU%C1 display value")
    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:12 -05:00
David Arcari ccdf18a706 tools/power/turbostat: Fix failure with new uncore sysfs
JIRA: https://issues.redhat.com/browse/RHEL-20029

commit 4d1827485acecac0016eaaec199e97697afdaa84
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Mon Jul 31 14:02:11 2023 +0800

    tools/power/turbostat: Fix failure with new uncore sysfs

    On some platforms, turbostat fails during launch time like below,

    turbostat version 2023.03.17 - Len Brown <lenb@kernel.org>
    ...
    cpu40: MSR_IA32_PACKAGE_THERM_STATUS: 0x884c0000 (24 C)
    cpu40: MSR_IA32_PACKAGE_THERM_INTERRUPT: 0x00000003 (100 C, 100 C)
    turbostat: snapshot_sysfs_counter(/sys/devices/system/cpu/intel_uncore_frequency/package_00_die_00/current_freq_khz): No data available

    This is because new uncore sysfs is used on these platforms as
    introduced by commit 9b8dea80e3cb ("platform/x86/intel-uncore-freq:
    Support for cluster level controls").

    With the new uncore sysfs interface,
    /sys/devices/system/cpu/intel_uncore_frequency/package_00_die_00/current_freq_khz
    is still available, but reading it fails.

    How to support the fabric cluster level uncore sysfs is not settled yet,
    as a short term fix, clear the BIC_UNCORE_MHZ bit when new sysfs I/F is
    detected.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-04 10:34:12 -05:00
Steve Best c86638a54b tools/power/x86/intel-speed-select: v1.18 release
JIRA: https://issues.redhat.com/browse/RHEL-17865

commit a590ed62269a049a72484ce617fe2f34e2da66cf
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Fri Oct 13 11:15:41 2023 -0700

    tools/power/x86/intel-speed-select: v1.18 release

    This version addresses issues with:
    - When CPU 0 hotplug is not possible, try cgroup v2 isolation
    without any user input
    - Fix turbo mode enable/disable swapped
    - Sanitize command line integer and hex arguments
    - Add more error messages
    - Increase CPU count in one request

    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: Steve Best <sbest@redhat.com>
2023-12-05 05:28:29 -05:00
Steve Best 32c9b5805f tools/power/x86/intel-speed-select: Use cgroup isolate for CPU 0
JIRA: https://issues.redhat.com/browse/RHEL-17865

commit 3bc0f20a8c59daa79aee2da119564f668f458afd
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Tue Oct 3 14:46:30 2023 -0700

    tools/power/x86/intel-speed-select: Use cgroup isolate for CPU 0

    From kernel version 6.5, CPU 0 hotplug capability is deprecated.
    If some SST profile doesn't have CPU 0, then it is no longer possible to
    offline CPU 0. This means that user space threads will still run on
    CPU 0.

    To workaround this issue, use cgroup v2 isolation feature. Whenever there
    /sys/devices/system/cpu/cpu0/online file is absent or open fails, isolate
    CPU 0 via CPU cgroup v2 isolation. Also add a command line option to
    force even if the /sys/devices/system/cpu/cpu0/online is present.

    The previous commit "01bcb56f059e ("tools/power/x86/intel-speed-select:
    Prevent CPU 0 offline") was just warning about this issue based on the
    kernel version 6.5 and above. With this new approach, instead of warning
    take action to mitigate the issue.

    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: Steve Best <sbest@redhat.com>
2023-12-05 05:28:22 -05:00
Steve Best 22f9533a93 tools/power/x86/intel-speed-select: Increase max CPUs in one request
JIRA: https://issues.redhat.com/browse/RHEL-17865

commit bc5370cca03ba9d1634fecd85e0cf99a0a3c0483
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Fri Oct 13 11:20:56 2023 -0700

    tools/power/x86/intel-speed-select: Increase max CPUs in one request

    With the increase in the CPU count, this count needs to be updated.
    Increase max CPU count to 512.

    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: Steve Best <sbest@redhat.com>
2023-12-05 05:28:16 -05:00
Steve Best fb56f8c456 tools/power/x86/intel-speed-select: Display error for core-power support
JIRA: https://issues.redhat.com/browse/RHEL-17865

commit da4c1b9e8f22d0567e308428e588e1f9e004ce74
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Thu Sep 7 17:07:19 2023 -0700

    tools/power/x86/intel-speed-select: Display error for core-power support

    When core-power is getting enabled, if the feaure is not supported,
    display error.

    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: Steve Best <sbest@redhat.com>
2023-12-05 05:28:07 -05:00
Steve Best fe5cfb4cae tools/power/x86/intel-speed-select: No TRL for non compute domains
JIRA: https://issues.redhat.com/browse/RHEL-17865

commit 2fe8d2d7911fb4e380c3dcb5655e1a62bb14f75e
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Thu Sep 7 17:12:55 2023 -0700

    tools/power/x86/intel-speed-select: No TRL for non compute domains

    Don't call to set or get TRL for domains in which there are no CPUs.

    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: Steve Best <sbest@redhat.com>
2023-12-05 05:28:01 -05:00
Steve Best e4eec42115 tools/power/x86/intel-speed-select: turbo-mode enable disable swapped
JIRA: https://issues.redhat.com/browse/RHEL-17865

commit 7b00d1018c8c8ed55aa1393b2ca234400eb6ca86
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Thu Sep 7 17:09:52 2023 -0700

    tools/power/x86/intel-speed-select: turbo-mode enable disable swapped

    The command for turbo-mode enable and disable is swapped. Fix that.
    Previously turbo-mode enable was actually disabling and disable was
    enabling.

    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: Steve Best <sbest@redhat.com>
2023-12-05 05:27:56 -05:00
Steve Best f2ed91200f tools/power/x86/intel-speed-select: Update help for TRL
JIRA: https://issues.redhat.com/browse/RHEL-17865

commit 3076db34b5ba87bb7a3335d16415befdea056d57
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Thu Sep 7 17:01:55 2023 -0700

    tools/power/x86/intel-speed-select: Update help for TRL

    TRL (turbo ratio limit) argument is passed in hex string. Clarify that
    in the help.

    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: Steve Best <sbest@redhat.com>
2023-12-05 05:27:51 -05:00
Steve Best 9dac91b256 tools/power/x86/intel-speed-select: Sanitize integer arguments
JIRA: https://issues.redhat.com/browse/RHEL-17865

commit 61f3d868b3d6f5e23a6d25597133d76d2186eddd
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Thu Sep 7 15:46:39 2023 -0700

    tools/power/x86/intel-speed-select: Sanitize integer arguments

    If the command takes some integer arguments, make sure the command
    contains only digits. Same for Hex arguments. Otherwise return error.

    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: Steve Best <sbest@redhat.com>
2023-12-05 05:27:45 -05:00
Scott Weaver 08a2cd895d Merge: perf/x86/intel: Add Crestmont PMU
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/3117

Bugzilla: https://bugzilla.redhat.com/2177050

upstream
========
commit a430021faad6b4fa86c820fc3e7f8dbfc2f14fb4
Author: Kan Liang <kan.liang@linux.intel.com>
Date: Mon May 22 04:30:35 2023 -0700

description
===========
The Grand Ridge and Sierra Forest are successors to Snow Ridge. They
both have Crestmont core. From the core PMU's perspective, they are
similar to the e-core of MTL. The only difference is the LBR event
logging feature, which will be implemented in the following patches.

Create a non-hybrid PMU setup for Grand Ridge and Sierra Forest.

    Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
    Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
    Reviewed-by: Andi Kleen <ak@linux.intel.com>
    Link: https://lore.kernel.org/r/20230522113040.2329924-1-kan.liang@linux.intel.com

Signed-off-by: Michael Petlan <mpetlan@redhat.com>

Approved-by: Aristeu Rozanski <arozansk@redhat.com>
Approved-by: Jerry Snitselaar <jsnitsel@redhat.com>
Approved-by: Dean Nelson <dnelson@redhat.com>
Approved-by: David Arcari <darcari@redhat.com>

Signed-off-by: Scott Weaver <scweaver@redhat.com>
2023-10-11 13:28:06 -04:00
Scott Weaver 0b16c5f18e Merge: cpupower: Make TSC read per CPU for Mperf monitor
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/3106

# Merge Request Required Information

## Summary of Changes
Add changes to lower drift in C0 percentage calculation when doing TSC reading.
Read TSC per CPU and also just after mperf reading to improve C0 percentage calculation in Mperf monitor.

Tested: See Jira issue for testing details
Signed-off-by: Joel Slebodnick <jslebodn@redhat.com>

## Approved Development Ticket
JIRA: https://issues.redhat.com/browse/RHEL-10052

Approved-by: Lenny Szubowicz <lszubowi@redhat.com>
Approved-by: David Arcari <darcari@redhat.com>
Approved-by: Prarit Bhargava <prarit@redhat.com>

Signed-off-by: Scott Weaver <scweaver@redhat.com>
2023-10-04 18:38:42 -04:00
Michael Petlan 983308506a x86/cpu: Fix Gracemont uarch
Bugzilla: https://bugzilla.redhat.com/2177050

upstream
========
commit 882cdb06b668488a42ef717a260c05ba7dc43a49
Author: Peter Zijlstra <peterz@infradead.org>
Date:   Mon Aug 7 14:38:07 2023 +0200

description
===========
Alderlake N is an E-core only product using Gracemont
micro-architecture. It fits the pre-existing naming scheme perfectly
fine, adhere to it.

    Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
    Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Acked-by: Hans de Goede <hdegoede@redhat.com>
    Link: https://lore.kernel.org/r/20230807150405.686834933@infradead.org

Conflicts:
==========
Some hunks touch code that we haven't backported yet. I don't take it,
since it is unrelated to my area. Namely, I mean these patches:
  - 7420ae3bb977 ("x86/intel_epb: Set Alder Lake N and Raptor Lake P normal EPB")
  - a414a08aefe6 ("drivers/thermal/intel: Add TCC cooling support for AlderLake platform")
  - 312c1a44da37 ("thermal: intel: Add TCC cooling support for Alder Lake-N and Raptor Lake-P")
  - 62f46fc7b8c6 ("thermal: intel_tcc_cooling: Add TCC cooling support for RaptorLake")

Signed-off-by: Michael Petlan <mpetlan@redhat.com>
2023-09-29 10:08:27 +02:00
Joel Slebodnick 99319a7de1 cpupower: Add Georgian translation to Makefile LANGUAGES
JIRA: https://issues.redhat.com/browse/RHEL-10052

commit af75504c38960d5331b8c6c83ea9981e26d659e6
Author: Shuah Khan <skhan@linuxfoundation.org>
Date:   Thu Aug 17 14:16:35 2023 -0600

    cpupower: Add Georgian translation to Makefile LANGUAGES

    Commit 4680b734e729 ("cpupower: Add Georgian translation") added
    new language support. This change didn't add "ka" to Makefile
    LANGUAGES variable. Add it now.

    Reported-by: Temuri Doghonadze <temuri.doghonadze@gmail.com>
    Reported-by: Zurab Kargareteli <zuraxt@gmail.com>
    Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

Signed-off-by: Joel Slebodnick <jslebodn@redhat.com>
2023-09-28 15:11:20 -04:00
Joel Slebodnick cf8b4e73e4 cpupower: Fix cpuidle_set to accept only numeric values for idle-set operation.
JIRA: https://issues.redhat.com/browse/RHEL-10052

commit 99481d2195bfd13a663904e6014887abf46b57c7
Author: Likhitha Korrapati <likhitha@linux.ibm.com>
Date:   Fri Jul 14 15:10:21 2023 +0530

    cpupower: Fix cpuidle_set to accept only numeric values for idle-set operation.

    For both the d and e options in 'cpupower idle_set' command, an
    atoi() conversion is done without checking if the input argument
    is all numeric. So, an atoi conversion is done on any character
    provided as input and the CPU idle_set operation continues with
    that integer value, which may not be what is intended or entirely
    correct.

    The output of cpuidle-set before patch is as follows:

    [root@xxx cpupower]# cpupower idle-set -e 1$
    Idlestate 1 enabled on CPU 0
    [snip]
    Idlestate 1 enabled on CPU 47

    [root@xxx cpupower]# cpupower idle-set -e 11
    Idlestate 11 not available on CPU 0
    [snip]
    Idlestate 11 not available on CPU 47

    [root@xxx cpupower]# cpupower idle-set -d 12
    Idlestate 12 not available on CPU 0
    [snip]
    Idlestate 12 not available on CPU 47

    [root@xxx cpupower]# cpupower idle-set -d qw
    Idlestate 0 disabled on CPU 0
    [snip]
    Idlestate 0 disabled on CPU 47

    This patch adds a check for both d and e options in cpuidle-set.c
    to see that the idle_set value is all numeric before doing a
    string-to-int conversion using strtol().

    The output of cpuidle-set after the patch is as below:

    [root@xxx cpupower]# ./cpupower idle-set -e 1$
    Bad idle_set value: 1$. Integer expected

    [root@xxx cpupower]# ./cpupower idle-set -e 11
    Idlestate 11 not available on CPU 0
    [snip]
    Idlestate 11 not available on CPU 47

    [root@xxx cpupower]# ./cpupower idle-set -d 12
    Idlestate 12 not available on CPU 0
    [snip]
    Idlestate 12 not available on CPU 47

    [root@xxx cpupower]# ./cpupower idle-set -d qw
    Bad idle_set value: qw. Integer expected

    Signed-off-by: Brahadambal Srinivasan <latha@linux.vnet.ibm.com>
    Signed-off-by: Likhitha Korrapati <likhitha@linux.ibm.com>
    Tested-by: Pavithra Prakash <pavrampu@linux.vnet.ibm.com>
    Reviewed-by: Rick Lindsley <ricklind@linux.vnet.ibm.com>
    Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

Signed-off-by: Joel Slebodnick <jslebodn@redhat.com>
2023-09-28 15:11:16 -04:00
Joel Slebodnick f3eef38895 cpupower: Add turbo-boost support in cpupower
JIRA: https://issues.redhat.com/browse/RHEL-10052

commit eb426fc6bdd6b731cbc0900f24a8c5fba10a7631
Author: Wyes Karny <wyes.karny@amd.com>
Date:   Mon Jun 19 19:05:03 2023 +0000

    cpupower: Add turbo-boost support in cpupower

    If boost sysfs (/sys/devices/system/cpu/cpufreq/boost) file is present
    turbo-boost is feature is supported in the hardware. By default this
    feature should be enabled. But to disable/enable it write to the sysfs
    file. Use the same to control this feature via cpupower.

    To enable:
    cpupower set --turbo-boost 1

    To disable:
    cpupower set --turbo-boost 0

    Acked-by: Huang Rui <ray.huang@amd.com>
    Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
    Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
    Signed-off-by: Wyes Karny <wyes.karny@amd.com>
    Tested-by: Perry Yuan <Perry.Yuan@amd.com>
    Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

Signed-off-by: Joel Slebodnick <jslebodn@redhat.com>
2023-09-28 15:11:12 -04:00
Joel Slebodnick e3f9b22c8d cpupower: Add support for amd_pstate mode change
JIRA: https://issues.redhat.com/browse/RHEL-10052

commit df8776b03689987e3239f3c010b6dc6ab4185d30
Author: Wyes Karny <wyes.karny@amd.com>
Date:   Mon Jun 19 19:05:02 2023 +0000

    cpupower: Add support for amd_pstate mode change

    amd_pstate supports changing of its mode dynamically via `status` sysfs
    file. Add the same capability in cpupower. To change the mode to active
    mode use below command:

    cpupower set --amd-pstate-mode active

    Acked-by: Huang Rui <ray.huang@amd.com>
    Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
    Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
    Signed-off-by: Wyes Karny <wyes.karny@amd.com>
    Tested-by: Perry Yuan <Perry.Yuan@amd.com>
    Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

Signed-off-by: Joel Slebodnick <jslebodn@redhat.com>
2023-09-28 15:11:07 -04:00
Joel Slebodnick c75764a214 cpupower: Add EPP value change support
JIRA: https://issues.redhat.com/browse/RHEL-10052

commit f2ab5557119a5ccd0ceaf7ecdca00ab782cd76c5
Author: Wyes Karny <wyes.karny@amd.com>
Date:   Mon Jun 19 19:05:01 2023 +0000

    cpupower: Add EPP value change support

    amd_pstate and intel_pstate active mode drivers support energy
    performance preference feature. Through this user can convey it's
    energy/performance preference to platform. Add this value change
    capability to cpupower.

    To change the EPP value use below command:
    cpupower set --epp performance

    Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
    Signed-off-by: Wyes Karny <wyes.karny@amd.com>
    Tested-by: Perry Yuan <Perry.Yuan@amd.com>
    Acked-by: Huang Rui <ray.huang@amd.com>
    Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

Signed-off-by: Joel Slebodnick <jslebodn@redhat.com>
2023-09-28 15:11:01 -04:00
Joel Slebodnick c93af13fed cpupower: Add is_valid_path API
JIRA: https://issues.redhat.com/browse/RHEL-10052

commit 1ce5ab7c1dbfa82f0d382a48cccb51178cbf5416
Author: Wyes Karny <wyes.karny@amd.com>
Date:   Mon Jun 19 19:05:00 2023 +0000

    cpupower: Add is_valid_path API

    Add is_valid_path API to check whether the sysfs file is present or not.

    Suggested-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
    Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
    Signed-off-by: Wyes Karny <wyes.karny@amd.com>
    Tested-by: Perry Yuan <Perry.Yuan@amd.com>
    Acked-by: Huang Rui <ray.huang@amd.com>
    Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

Signed-off-by: Joel Slebodnick <jslebodn@redhat.com>
2023-09-28 15:10:57 -04:00
Joel Slebodnick 56f9c6e055 cpupower: Recognise amd-pstate active mode driver
JIRA: https://issues.redhat.com/browse/RHEL-10052

commit a1cf97c2d43ae51f3de091d51adff6b70a5cd55c
Author: Wyes Karny <wyes.karny@amd.com>
Date:   Mon Jun 19 19:04:59 2023 +0000

    cpupower: Recognise amd-pstate active mode driver

    amd-pstate active mode driver name is "amd-pstate-epp". Use common
    prefix for string matching condition to recognise amd-pstate active mode
    driver.

    Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
    Signed-off-by: Wyes Karny <wyes.karny@amd.com>
    Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
    Tested-by: Perry Yuan <Perry.Yuan@amd.com>
    Acked-by: Huang Rui <ray.huang@amd.com>
    Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

Signed-off-by: Joel Slebodnick <jslebodn@redhat.com>
2023-09-28 15:10:51 -04:00
Joel Slebodnick e265df40c4 cpupower: Bump soname version
JIRA: https://issues.redhat.com/browse/RHEL-10052

commit d7de5d8e403a1293e10f8f59a1f2db320232c831
Author: Ben Hutchings <ben@decadent.org.uk>
Date:   Wed May 17 21:10:20 2023 +0200

    cpupower: Bump soname version

    Several functions in the libcpupower API are renamed or removed in
    Linux 4.7.  This is an backward-incompatible ABI change, so the
    library soname should change from libcpupower.so.0 to
    libcpupower.so.1.

    Fixes: ac5a181d06 ("cpupower: Add cpuidle parts into library")
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
    Signed-off-by: Salvatore Bonaccorso <carnil@debian.org>
    Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

Signed-off-by: Joel Slebodnick <jslebodn@redhat.com>
2023-09-28 15:10:32 -04:00
Joel Slebodnick bae4498c46 cpupower: Make TSC read per CPU for Mperf monitor
JIRA: https://issues.redhat.com/browse/RHEL-10052

commit c2adb1877b76fc81ae041e1db1a6ed2078c6746b
Author: Wyes Karny <wyes.karny@amd.com>
Date:   Thu May 4 06:25:44 2023 +0000

    cpupower: Make TSC read per CPU for Mperf monitor

    System-wide TSC read could cause a drift in C0 percentage calculation.
    Because if first TSC is read and then one by one mperf is read for all
    cpus, this introduces drift between mperf reading of later CPUs and TSC
    reading.  To lower this drift read TSC per CPU and also just after mperf
    read.  This technique improves C0 percentage calculation in Mperf monitor.

    Before fix: (System 100% busy)

                  | Mperf              || RAPL        || Idle_Stats
     PKG|CORE| CPU| C0   | Cx   | Freq  || pack | core  || POLL | C1   | C2
       0|   0|   0| 87.15| 12.85|  2695||168659003|3970468||  0.00|  0.00| 0.00
       0|   0| 256| 84.62| 15.38|  2695||168659003|3970468||  0.00|  0.00| 0.00
       0|   1|   1| 87.15| 12.85|  2695||168659003|3970468||  0.00|  0.00| 0.00
       0|   1| 257| 84.08| 15.92|  2695||168659003|3970468||  0.00|  0.00| 0.00
       0|   2|   2| 86.61| 13.39|  2695||168659003|3970468||  0.00|  0.00| 0.00
       0|   2| 258| 83.26| 16.74|  2695||168659003|3970468||  0.00|  0.00| 0.00
       0|   3|   3| 86.61| 13.39|  2695||168659003|3970468||  0.00|  0.00| 0.00
       0|   3| 259| 83.60| 16.40|  2695||168659003|3970468||  0.00|  0.00| 0.00
       0|   4|   4| 86.33| 13.67|  2695||168659003|3970468||  0.00|  0.00| 0.00
       0|   4| 260| 83.33| 16.67|  2695||168659003|3970468||  0.00|  0.00| 0.00
       0|   5|   5| 86.06| 13.94|  2695||168659003|3970468||  0.00|  0.00| 0.00
       0|   5| 261| 83.05| 16.95|  2695||168659003|3970468||  0.00|  0.00| 0.00
       0|   6|   6| 85.51| 14.49|  2695||168659003|3970468||  0.00|  0.00| 0.00

    After fix: (System 100% busy)

                 | Mperf              || RAPL        || Idle_Stats
     PKG|CORE| CPU| C0   | Cx   | Freq  || pack | core  || POLL | C1   | C2
       0|   0|   0| 98.03|  1.97|  2415||163295480|3811189||  0.00|  0.00| 0.00
       0|   0| 256| 98.50|  1.50|  2394||163295480|3811189||  0.00|  0.00| 0.00
       0|   1|   1| 99.99|  0.01|  2401||163295480|3811189||  0.00|  0.00| 0.00
       0|   1| 257| 99.99|  0.01|  2375||163295480|3811189||  0.00|  0.00| 0.00
       0|   2|   2| 99.99|  0.01|  2401||163295480|3811189||  0.00|  0.00| 0.00
       0|   2| 258|100.00|  0.00|  2401||163295480|3811189||  0.00|  0.00| 0.00
       0|   3|   3|100.00|  0.00|  2401||163295480|3811189||  0.00|  0.00| 0.00
       0|   3| 259| 99.99|  0.01|  2435||163295480|3811189||  0.00|  0.00| 0.00
       0|   4|   4|100.00|  0.00|  2401||163295480|3811189||  0.00|  0.00| 0.00
       0|   4| 260|100.00|  0.00|  2435||163295480|3811189||  0.00|  0.00| 0.00
       0|   5|   5| 99.99|  0.01|  2401||163295480|3811189||  0.00|  0.00| 0.00
       0|   5| 261|100.00|  0.00|  2435||163295480|3811189||  0.00|  0.00| 0.00
       0|   6|   6|100.00|  0.00|  2401||163295480|3811189||  0.00|  0.00| 0.00
       0|   6| 262|100.00|  0.00|  2435||163295480|3811189||  0.00|  0.00| 0.00

    Cc: Thomas Renninger <trenn@suse.com>
    Cc: Shuah Khan <shuah@kernel.org>
    Cc: Dominik Brodowski <linux@dominikbrodowski.net>

    Fixes: 7fe2f6399a ("cpupowerutils - cpufrequtils extended with quite some features")
    Signed-off-by: Wyes Karny <wyes.karny@amd.com>
    Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

Signed-off-by: Joel Slebodnick <jslebodn@redhat.com>
2023-09-28 15:10:27 -04:00
Joel Slebodnick 8911734815 cpupower:Fix resource leaks in sysfs_get_enabled()
JIRA: https://issues.redhat.com/browse/RHEL-10052

commit e652be0f59d4ba4d5c636b1f7f4dcb73aae049fa
Author: Hao Zeng <zenghao@kylinos.cn>
Date:   Tue Apr 18 09:30:56 2023 +0800

    cpupower:Fix resource leaks in sysfs_get_enabled()

    The sysfs_get_enabled() opened file processor not closed,
    may cause a file handle leak.
    Putting error handling and resource cleanup code together
    makes the code easy to maintain and read.
    Removed the unnecessary else if branch from the original
    function, as it should return an error in cases other than '0'.

    Signed-off-by: Hao Zeng <zenghao@kylinos.cn>
    Suggested-by: Shuah Khan <skhan@linuxfoundation.org>
    Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

Signed-off-by: Joel Slebodnick <jslebodn@redhat.com>
2023-09-28 15:10:13 -04:00
Joel Slebodnick 7ab0ce979c cpupower: rapl monitor - shows the used power consumption in uj for each rapl domain
JIRA: https://issues.redhat.com/browse/RHEL-10052

commit 8c37df3d635eac64a8fbb4b26672fb881e0cb673
Author: Thomas Renninger <trenn@suse.de>
Date:   Wed Nov 23 12:18:10 2022 +0100

    cpupower: rapl monitor - shows the used power consumption in uj for each rapl domain

    This CPU power monitor shows the power consumption
    as exposed by the powercap subsystem, cmp with:
    Documentation/power/powercap/powercap.rst

    cpupower monitor -m RAPL
        | RAPL
     CPU| pack | core | unco
       0|6853926|967832|442381
       8|6853926|967832|442381
       1|6853926|967832|442381
       9|6853926|967832|442381

    Unfortunately RAPL domains cannot be directly mapped to the corresponding
    CPU socket/package, core it belongs to.
    Not sure this is possible at all with the current data exposed from the
    kernel.

    Still it can be worthful information for developers trying to optimize
    power consumption of workloads or their system in general.

    Signed-off-by: Thomas Renninger <trenn@suse.de>
    CC: Zhang Rui <rui.zhang@intel.com>
    CC: Shuah Khan <skhan@linuxfoundation.org>
    Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

Signed-off-by: Joel Slebodnick <jslebodn@redhat.com>
2023-09-28 15:10:03 -04:00
Joel Slebodnick 60e67f1050 cpupower: Introduce powercap intel-rapl library and powercap-info command
JIRA: https://issues.redhat.com/browse/RHEL-10052

commit c2294c1496b7169d5b14c2fa27526ba35da9f5ac
Author: Thomas Renninger <trenn@suse.de>
Date:   Wed Nov 23 12:18:09 2022 +0100

    cpupower: Introduce powercap intel-rapl library and powercap-info command

    Read out powercap zone information via:
    cpupower powercap-info
    and show the zone hierarchy to the user:

    ./cpupower powercap-info
    Driver: intel-rapl
    Powercap domain hierarchy:

    Zone: package-0 (enabled)
    Power consumption can be monitored in micro Watts

            Zone: core (disabled)
            Power consumption can be monitored in micro Watts

            Zone: uncore (disabled)
            Power consumption can be monitored in micro Watts

            Zone: dram (disabled)
            Power consumption can be monitored in micro Watts

    There is a dummy -a option for powercap-info which can/should be used to
    show more detailed info later. Like that other args can be added easily
    later as well.

    A enable/disable option via powercap-set subcommand is also an enhancement
    for later.

    Also not all RAPL domains are shown. The func walking through RAPL
    subdomains is restricted and hardcoded to: "intel-rapl/intel-rapl:0"
    On my system above powercap domains map to:
    intel-rapl/intel-rapl:0
    -> pack (age-0)
    intel-rapl/intel-rapl:0/intel-rapl:0:0
    -> core
    intel-rapl/intel-rapl:0/intel-rapl:0:1
    -> uncore

    Missing ones on my system are:
    intel-rapl-mmio/intel-rapl-mmio:0
    -> pack (age-0)

    intel-rapl/intel-rapl:1
    -> psys

    This could get enhanced in:
    struct powercap_zone *powercap_init_zones()
    and adopted to walk through all intel-rapl zones, but
    also to other powercap drivers like dtpm
    (Dynamic Thermal Power Management framework),
    cmp with: drivers/powercap/dtpm_*

    Signed-off-by: Thomas Renninger <trenn@suse.de>
    CC: Shuah Khan <skhan@linuxfoundation.org>
    Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

Signed-off-by: Joel Slebodnick <jslebodn@redhat.com>
2023-09-28 15:09:55 -04:00
Joel Slebodnick 8428cd4359 cpupower: Add Georgian translation
JIRA: https://issues.redhat.com/browse/RHEL-10052

commit 4680b734e7291cd804c4ea2c377935a2332366b1
Author: Zurab Kargareteli <zuraxt@gmail.com>
Date:   Tue Nov 29 00:01:27 2022 +0400

    cpupower: Add Georgian translation

    Add Georgian language for cpupower

    Signed-off-by: Zurab Kargareteli <zuraxt@gmail.com>
    Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

Signed-off-by: Joel Slebodnick <jslebodn@redhat.com>
2023-09-28 15:09:48 -04:00
Joel Slebodnick 17156b94c2 tools/cpupower: Choose base_cpu to display default cpupower details
JIRA: https://issues.redhat.com/browse/RHEL-10052

commit 5975e2558e2dea7ef35fbb1a29613e1c176bd190
Author: Saket Kumar Bhaskar <skb99@linux.vnet.ibm.com>
Date:   Wed Nov 23 13:52:08 2022 +0530

    tools/cpupower: Choose base_cpu to display default cpupower details

    The default output of cpupower info utils shows unexpected output
    when CPU 0 is disabled.

    Considering a case where CPU 0 is disabled, output of cpupower idle-info:

    Before change:
    cpupower idle-info
    CPUidle driver: pseries_idle
    CPUidle governor: menu
    analyzing CPU 0:
     *is offline

    After change:
    ./cpupower idle-info
    CPUidle driver: pseries_idle
    CPUidle governor: menu
    analyzing CPU 50:

    Number of idle states: 2
    Available idle states: snooze CEDE
    snooze:
    Flags/Description: snooze
    Latency: 0
    Usage: 101748
    Duration: 2724058
    CEDE:
    Flags/Description: CEDE
    Latency: 12
    Usage: 270004
    Duration: 283019526849

    If -c option is not passed, CPU 0 was chosen as the default chosen CPU to
    display details. However when CPU 0 is offline, it results in showing
    unexpected output. This commit chooses the base_cpu
    instead of CPU 0, hence keeping the output more relevant in all cases.
    The base_cpu is the number of CPU on which the calling thread is
    currently executing.

    Signed-off-by: Saket Kumar Bhaskar <skb99@linux.vnet.ibm.com>
    Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

Signed-off-by: Joel Slebodnick <jslebodn@redhat.com>
2023-09-28 15:09:40 -04:00
Joel Slebodnick fd1df2473e treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_385.RULE
JIRA: https://issues.redhat.com/browse/RHEL-10052

commit fa82cce7a6bbb35ecf7fe66231c7076052cf66d5
Author: Thomas Gleixner <tglx@linutronix.de>
Date:   Tue Jun 7 16:11:34 2022 +0200

    treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_385.RULE

    Based on the normalized pattern:

        licensed under the gpl v2

    extracted by the scancode license scanner the SPDX license identifier

        GPL-2.0-only

    has been chosen to replace the boilerplate/reference.

    Reviewed-by: Allison Randal <allison@lohutok.net>
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Joel Slebodnick <jslebodn@redhat.com>
2023-09-28 15:09:14 -04:00
David Arcari b2bf014523 tools/power/x86/intel-speed-select: v1.17 release
Bugzilla: https://bugzilla.redhat.com/2177018

commit 2fff509adceb10f991b259c02ef2e096a89f075e
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Tue Aug 8 14:37:02 2023 -0700

    tools/power/x86/intel-speed-select: v1.17 release

    This version addresses issues with:
    - CPU count display for power domain != 0
    - Support more than 8 sockets
    - Error on max CPU count exceeds in one request
    - Prevent trying CPU 0 hotplug for kernel version 6.5 or later
    - Change mem-frequency display to max-mem-frequency

    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:48 -04:00
David Arcari 3a1671e657 tools/power/x86/intel-speed-select: Change mem-frequency display name
Bugzilla: https://bugzilla.redhat.com/2177018

commit dde9293b62c5af5c905f371ea47f10b5ab257624
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Wed Aug 9 08:53:04 2023 -0700

    tools/power/x86/intel-speed-select: Change mem-frequency display name

    The mem-frequency displayed by each profile is not the actual memory
    frequency of DIMMs, but the maximum the CPU can support.

    Change the mem-frequency field to max-mem-frequency.

    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:48 -04:00
David Arcari 6eb4cb7185 tools/power/x86/intel-speed-select: Prevent CPU 0 offline
Bugzilla: https://bugzilla.redhat.com/2177018

commit 01bcb56f059e1e9a56e1d121a0dc09df9e1714ff
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Tue Aug 8 14:12:01 2023 -0700

    tools/power/x86/intel-speed-select: Prevent CPU 0 offline

    Kernel 6.5 version deprecated CPU 0 hotplug. This will cause all
    requests to fail to offline CPU 0. Check version number of kernel
    and ignore CPU 0 hotplug request with debug aid to use cgroup
    isolation feature for CPU 0.

    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:48 -04:00
David Arcari 89b814908f tools/power/x86/intel-speed-select: Error on CPU count exceed in request
Bugzilla: https://bugzilla.redhat.com/2177018

commit e67b6ed2bbd1516f949202503207f44b3066bdec
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Tue Aug 8 13:08:03 2023 -0700

    tools/power/x86/intel-speed-select: Error on CPU count exceed in request

    There is a limit on number of CPUs in one request. This is set to 256.
    Currently tool silently ignores request for count over 256. Give an
    error message to indicate this.

    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:48 -04:00
David Arcari f418b6df2a tools/power/x86/intel-speed-select: Support more than 8 sockets.
Bugzilla: https://bugzilla.redhat.com/2177018

commit 06bbebdb6da5e816f206c09ce20321237e5910e9
Author: Frank Ramsay <frank.ramsay@hpe.com>
Date:   Thu Jul 20 11:08:03 2023 -0500

    tools/power/x86/intel-speed-select: Support more than 8 sockets.

    MAX_PACKAGE_COUNT limits the intel-speed-select to systems with 8 sockets or fewer.
    On a system with more than 8 sockets intel-speed-select silently ignores everything
    beyond the 8th socket, rendering the tool useless for those systems.

    Increase MAX_PACKAGE_COUNT to support systems with up to 32 sockets.

    Signed-off-by: Frank Ramsay <frank.ramsay@hpe.com>
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:48 -04:00
David Arcari 11766d6623 tools/power/x86/intel-speed-select: Fix CPU count display
Bugzilla: https://bugzilla.redhat.com/2177018

commit 7a4ab2f4795bfa7cfe10330ce4a2452748f31b68
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Thu Jun 15 16:18:15 2023 -0700

    tools/power/x86/intel-speed-select: Fix CPU count display

    Fix CPU count display for power domain != 0. In the function
    punit_id is always 0, so it never incremented cpu count for power
    domain id != 0.

    Update punit_id after call to update_punit_cpu_info() to what is
    actually received from the kernel.

    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:48 -04:00
David Arcari c82a630e9f tools/power/x86/intel-speed-select: v1.16 release
Bugzilla: https://bugzilla.redhat.com/2177018

commit 7244720ac137e3193db11b009fc33c0dd4e999c9
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Mon Jun 12 16:10:37 2023 -0700

    tools/power/x86/intel-speed-select: v1.16 release

    This version addresses issues with core power configuration for
    non CPU dies. Also address issue with JSON formatting of output.

    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:48 -04:00
David Arcari 87e43e3a1c tools/power/x86/intel-speed-select: Fix json formatting issue
Bugzilla: https://bugzilla.redhat.com/2177018

commit fcf127839e6a37bfb0f3ac102c8bc7988f627df2
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Mon May 22 12:55:24 2023 -0700

    tools/power/x86/intel-speed-select: Fix json formatting issue

    Fix two issues related to JSON formatting:
    1.
    intel-speed-select -f json -o cp.out -c 1 core-power assoc -c 1
    Intel(R) Speed Select Technology
    Executing on CPU model:143[0x8f]
    [root@spr-bkc bin]# cat cp.out | jq .
    "package-0:die-0:cpu-1"

    2.
    intel-speed-select -f json -o tf.out turbo-freq enable -a
    Intel(R) Speed Select Technology
    Executing on CPU model:143[0x8f]
    [root@spr-bkc bin]# cat tf.out | jq .
    {
      "package-0:die-0:cpu-0": {
        "turbo-freq": {
          "enable": "success"
        }
      },
      "package-1:die-0:cpu-48": {
        "turbo-freq": {
          "enable": "success"
        }
      }
    }
    "turbo-freq --auto"
    parse error: Expected string key before ':' at line 17, column 24

    Both of these issues needed proper closing "}" for JSON.

    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:48 -04:00
David Arcari 70f066b1d5 tools/power/x86/intel-speed-select: Adjust scope of core-power config
Bugzilla: https://bugzilla.redhat.com/2177018

commit 4ebde55b7de1a25a9e20ae91e42157798ef8e958
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Thu May 18 09:49:35 2023 -0700

    tools/power/x86/intel-speed-select: Adjust scope of core-power config

    When core-power configuration or enabled is modified, this is only done
    for compute dies. But the config must also be set to cores with no CPUs.
    Without this the configuration is not affective.

    On displaying config information, allow display for non compute dies
    also.

    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:48 -04:00
David Arcari ba0668afb3 tools/power/x86/intel-speed-select: Change TRL display for Emerald Rapids
Bugzilla: https://bugzilla.redhat.com/2177018

commit 2c00056f54299983009c13a8790fa004e5337d16
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Thu Feb 23 06:36:46 2023 -0800

    tools/power/x86/intel-speed-select: Change TRL display for Emerald Rapids

    Emerald Rapids doesn't specify TRL (Turbo Ratio Limits) based instruction
    types. Instead it specifies 5 TRL levels, which can be anyone of the
    instruction types.

    Increase TRL levels to 5 for Emerald Rapids. Also change display to show
    by level number. Show only non zero level values.

    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:48 -04:00
David Arcari 3b71679ff6 tools/power/x86/intel-speed-select: Display AMX base frequency
Bugzilla: https://bugzilla.redhat.com/2177018

commit a835ff56dd9ce2dfc53526085ba8efc2807b9bcb
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Thu Feb 23 05:59:24 2023 -0800

    tools/power/x86/intel-speed-select: Display AMX base frequency

    AMX frequency is present in non TPMI platforms also. When platform
    supports, the value is non zero. So, display AMX base frequency when
    non zero, irrespective of platform API version.

    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:48 -04:00
David Arcari 21f32b90d8 tools/power/x86/intel-speed-select: Identify Emerald Rapids
Bugzilla: https://bugzilla.redhat.com/2177018

commit 1d54b139f43482a5d394f26ce47aa9949dec6e76
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Wed Feb 22 22:53:02 2023 -0800

    tools/power/x86/intel-speed-select: Identify Emerald Rapids

    There are some differences compared to Sapphire Rapids. So, add a separate
    API.

    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:48 -04:00
David Arcari cb6b6d3538 tools/power/x86/intel-speed-select: Update version
Bugzilla: https://bugzilla.redhat.com/2177018

commit 19799d3ae2edec99435b792cfe76b1cba74665fe
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Mon Oct 17 19:34:14 2022 +0800

    tools/power/x86/intel-speed-select: Update version

    Update tool and supported API version. This is the first version which
    supports newer Xeon platforms with TPMI support.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: subject and changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:48 -04:00
David Arcari 1710556dbb tools/power/x86/intel-speed-select: Use cgroup v2 isolation
Bugzilla: https://bugzilla.redhat.com/2177018

commit 997074df658e444e79a5294b685b77b08a3c414c
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Wed Feb 22 03:42:19 2023 -0800

    tools/power/x86/intel-speed-select: Use cgroup v2 isolation

    On supported systems, it is possiible to isolate CPUs instead of
    CPU online/offline. This is optional and can be specified using
    -g option when running as daemon or in combination with -o option
    for SST-PP level change.

    CPU isolation doesn't isolate IRQs. So IRQs needs to be moved away
    from isoolated CPUs. This can be done via IRQ sysfs or irqbalance daemon.

    The IRQ balance daemon is also capable to parse thermal HFI messages to
    move IRQs away from CPUS, which are supposed be isolated. But this
    requires version released after July 2022.

    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:47 -04:00
David Arcari 1fe83d5a09 tools/power/x86/intel-speed-select: Add missing free cpuset
Bugzilla: https://bugzilla.redhat.com/2177018

commit 57797f19d5a78b5a84b7452790f7da22865f6420
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Wed Feb 22 03:26:29 2023 -0800

    tools/power/x86/intel-speed-select: Add missing free cpuset

    During perf level change cpuset is allocated but not freed.
    Add free_cpu_set() in success and failure path.

    Although this is not an issue, as the program will exit after
    processing of online/offline, but for completeness add the
    free_cpu_set().

    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:47 -04:00
David Arcari aa0496b3e5 tools/power/x86/intel-speed-select: Fix clos-max display with TPMI I/F
Bugzilla: https://bugzilla.redhat.com/2177018

commit 137ba3b13aacf80b64d363dd7cff69c2aed161f0
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sat Jan 7 21:45:42 2023 +0800

    tools/power/x86/intel-speed-select: Fix clos-max display with TPMI I/F

    Comparing clos_config->clos_max with 255 is broken with TPMI I/F because
    of different isst_get_disp_freq_multiplier() used.

    Checking for clos_config->clos_max * isst_get_disp_freq_multiplier()
    instead.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:47 -04:00
David Arcari b10a2607d4 tools/power/x86/intel-speed-select: Add cpu id check
Bugzilla: https://bugzilla.redhat.com/2177018

commit d0e12c46f518620551d719b19b93777dafd0b5e6
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Tue Sep 13 20:23:19 2022 +0800

    tools/power/x86/intel-speed-select: Add cpu id check

    Some operations applies to cpu-power-domain only. Add check for cpu id
    for these functions.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:47 -04:00
David Arcari 9ab0fba5ec tools/power/x86/intel-speed-select: Avoid setting duplicate tdp level
Bugzilla: https://bugzilla.redhat.com/2177018

commit 14f0cf6cfa53a3a4f2f713b1d54eb71e96ff34cb
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Thu Feb 2 15:55:25 2023 +0800

    tools/power/x86/intel-speed-select: Avoid setting duplicate tdp level

    If the new TDP level requetsted is same as the current TDP level, don't
    call into driver to change level.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:47 -04:00
David Arcari d882e82b75 tools/power/x86/intel-speed-select: Remove cpu mask display for non-cpu power domain
Bugzilla: https://bugzilla.redhat.com/2177018

commit c7ff8ff3b29ee031a2194f67b5ceced9b77fdc21
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Thu Aug 18 21:26:23 2022 +0800

    tools/power/x86/intel-speed-select: Remove cpu mask display for non-cpu power domain

    Non CPU power domains will not have any CPUs. So don't display any CPU
    count or enable mask.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: subject and changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:47 -04:00
David Arcari f49c8119a3 tools/power/x86/intel-speed-select: Hide invalid TRL level
Bugzilla: https://bugzilla.redhat.com/2177018

commit c5a295caefa33ce7599d7afbe7a2e9b1bc8d92a2
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Thu Aug 18 21:21:46 2022 +0800

    tools/power/x86/intel-speed-select: Hide invalid TRL level

    TRL levels with Zero ratio values is meaningless.
    Prevent these TRL levels from being displayed.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:47 -04:00
David Arcari 3a3c79f836 tools/power/x86/intel-speed-select: Display fact info for non-cpu power domain
Bugzilla: https://bugzilla.redhat.com/2177018

commit b1e9b87b3b5999786685eb882afb99c468af94c1
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Thu Aug 18 21:18:03 2022 +0800

    tools/power/x86/intel-speed-select: Display fact info for non-cpu power domain

    Allow displaying SST-TF info for non-cpu power domain.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:47 -04:00
David Arcari f8786bc478 tools/power/x86/intel-speed-select: Show level 0 name for new api_version
Bugzilla: https://bugzilla.redhat.com/2177018

commit ca7c5d5b75fdac884d2ad6acd7cb28e3f1dfee9c
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Thu Aug 18 01:51:15 2022 +0800

    tools/power/x86/intel-speed-select: Show level 0 name for new api_version

    level 0 name is not shown in some case for backward compatibility reason.
    No need to keep this quirk for new api_version.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:47 -04:00
David Arcari 3785e75a9e tools/power/x86/intel-speed-select: Prevent cpu clos config for non-cpu power domain
Bugzilla: https://bugzilla.redhat.com/2177018

commit 443bf104ef10cfc0d22698613f8ba178427d4538
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Thu Aug 18 01:45:33 2022 +0800

    tools/power/x86/intel-speed-select: Prevent cpu clos config for non-cpu power domain

    Non-cpu power domain does not support cpu clos config.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:47 -04:00
David Arcari 6fa7ee3c11 tools/power/x86/intel-speed-select: Allow display non-cpu power domain info
Bugzilla: https://bugzilla.redhat.com/2177018

commit 2e54ba89ec5286d041999e6566ae96267d33b002
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Thu Aug 18 01:34:55 2022 +0800

    tools/power/x86/intel-speed-select: Allow display non-cpu power domain info

    Some power domain may not have CPUs associated, allow displaying
    information for these non-cpu power domains.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:47 -04:00
David Arcari 7af3167d04 tools/power/x86/intel-speed-select: Display punit info
Bugzilla: https://bugzilla.redhat.com/2177018

commit 46de87e39b871f926b429b14bde845412b541841
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Wed Aug 10 17:14:11 2022 +0800

    tools/power/x86/intel-speed-select: Display punit info

    Display punit info for platforms with new api_version.
    For platforms with old api_version, don't display the punit info to be
    backward compatible.

    For example:

    Intel(R) Speed Select Technology
    Executing on CPU model:173[0xad]
     package-0
      die-0
        powerdomain-0
          cpu-0
            get-config-current_level:0
     package-0
      die-0
        powerdomain-3
          cpu--1
            get-config-current_level:0
     package-0
      die-0
        powerdomain-4
          cpu--1
            get-config-current_level:0

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:47 -04:00
David Arcari 721940a4e6 tools/power/x86/intel-speed-select: Display amx_p1 and cooling_type
Bugzilla: https://bugzilla.redhat.com/2177018

commit 5f319081657cb653b55d2c9ef393fc5cd7aae6d4
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Tue Aug 9 03:29:23 2022 +0800

    tools/power/x86/intel-speed-select: Display amx_p1 and cooling_type

    amx_p1 and cooling_type are newly introduced for TPMI interface.

    Display amx_p1 and cooling_type info for platforms that support them.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:47 -04:00
David Arcari ab57bbf171 tools/power/x86/intel-speed-select: Introduce TPMI interface support
Bugzilla: https://bugzilla.redhat.com/2177018

commit 79554aaa224a3b99f95b9c2843dc904764c32541
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Tue Aug 9 00:01:00 2022 +0800

    tools/power/x86/intel-speed-select: Introduce TPMI interface support

    TPMI (Topology Aware Register and PM Capsule Interface) creates a
    flexible, extendable and software-PCIe-driver-enumerable MMIO interface
    for PM features.

    SST feature is exposed via the TPMI interface on newer Xeon platforms.

    Kernel TPMI based SST driver provides a series of new IOCTLs for userspace
    to use.

    Introduce support for the platforms that do SST control via TPMI interface.

    Compared with previous platforms, Newer Xeons also supports multi-punit in a
    package/die, including cpu punit and non-cpu punit. These have already
    been handled in the generic code.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:46 -04:00
David Arcari 46ae852b2a tools/power/x86/intel-speed-select: Get punit core mapping information
Bugzilla: https://bugzilla.redhat.com/2177018

commit a0ca5a097342f78d41e104d8d6bb0742ff0e7330
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Mon Mar 6 09:26:28 2023 -0800

    tools/power/x86/intel-speed-select: Get punit core mapping information

    Get punit core mapping information using format of MSR 0x54. Based
    on the API version, decode is done using new format. The new format
    also include a power domain ID. TPMI SST information is for each
    power domain.

    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:46 -04:00
David Arcari a747639b73 tools/power/x86/intel-speed-select: Introduce api_version helper
Bugzilla: https://bugzilla.redhat.com/2177018

commit 887e5be91dd253ff73c0b2644442c0cae5d6dca0
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sat Aug 20 20:51:33 2022 +0800

    tools/power/x86/intel-speed-select: Introduce api_version helper

    In some cases, the output format may be different with different
    api_version because of different capabilities or for backward
    capabilities reason.

    Introduce api_version() to get the api_version of the platform running.

    No functional changes are expected.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:46 -04:00
David Arcari d4cf8e2885 tools/power/x86/intel-speed-select: Support large clos_min/max
Bugzilla: https://bugzilla.redhat.com/2177018

commit 20f06c9db22bf45de595a2a5855630b075596217
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Tue Aug 16 21:20:00 2022 +0800

    tools/power/x86/intel-speed-select: Support large clos_min/max

    clos_min/max in TPMI interface is frequency in MHz, thus clos_min/max
    needs to support larger values.

    No functional changes are expected.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:46 -04:00
David Arcari f688967fc8 tools/power/x86/intel-speed-select: Abstract adjust_uncore_freq
Bugzilla: https://bugzilla.redhat.com/2177018

commit 73452ccc190a416929ccf7da4061365a5eaff627
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Thu Feb 2 15:52:42 2023 +0800

    tools/power/x86/intel-speed-select: Abstract adjust_uncore_freq

    Allow platform specific implementation to adjust the uncore frequency.

    No functional changes are expected.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:46 -04:00
David Arcari 184a04c5aa tools/power/x86/intel-speed-select: Allow api_version based platform callbacks
Bugzilla: https://bugzilla.redhat.com/2177018

commit 05aab5b8c1b78c028cd95701e788623de744d1cd
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sat Aug 20 20:40:48 2022 +0800

    tools/power/x86/intel-speed-select: Allow api_version based platform callbacks

    Different api_version suggests different kernel driver used and
    different interface is used to communication with the hardware.

    Allow setting platform specific callbacks based on api_version.

    Currently, all platforms with api_version 1 uses Mbox/MMIO interfaces.

    No functional changes are expected.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:46 -04:00
David Arcari a3e80cf782 tools/power/x86/intel-speed-select: Move send_mbox_cmd to isst-core-mbox.c
Bugzilla: https://bugzilla.redhat.com/2177018

commit 2b86ed225e657867b405b3e9412e9efefcbe6ffb
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sat Aug 20 20:14:15 2022 +0800

    tools/power/x86/intel-speed-select: Move send_mbox_cmd to isst-core-mbox.c

    After the previous cleanup, there is no user of send_mbox_cmd outside of
    isst-core-mbox.c.
    Thus move send_mbox_cmd to isst-core-mbox.c as internal functions.

    No functional changes are expected.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:46 -04:00
David Arcari f05c2a154b tools/power/x86/intel-speed-select: Introduce is_debug_enabled()
Bugzilla: https://bugzilla.redhat.com/2177018

commit 9798768ce9bc4da626091f4f87fc0a8edbee44d5
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Tue Aug 9 01:56:04 2022 +0800

    tools/power/x86/intel-speed-select: Introduce is_debug_enabled()

    Platform specific code also needs to give debug output.
    Introduce is_debug_enabled() for this purpose.

    No functional changes are expected.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:46 -04:00
David Arcari 32438fdde0 tools/power/x86/intel-speed-select: Abstract read_pm_config
Bugzilla: https://bugzilla.redhat.com/2177018

commit 8f54104f7a9548466027e1ee8482b18c2a72656a
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Mon Aug 8 23:19:55 2022 +0800

    tools/power/x86/intel-speed-select: Abstract read_pm_config

    Allow platform specific implementation to get SST-CP capability and
    current state.

    No functional changes are expected.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:46 -04:00
David Arcari 8c218d097a tools/power/x86/intel-speed-select: Abstract clos_associate
Bugzilla: https://bugzilla.redhat.com/2177018

commit a59a6c0cadd5f0d9a6837b7f62300f7985ea0de3
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Mon Aug 8 22:57:55 2022 +0800

    tools/power/x86/intel-speed-select: Abstract clos_associate

    Allow platform specific implementation to set per core CLOS setting.

    No functional changes are expected.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:46 -04:00
David Arcari cf78f2d33f tools/power/x86/intel-speed-select: Abstract clos_get_assoc_status
Bugzilla: https://bugzilla.redhat.com/2177018

commit b161bbad6db9a1e8d7cada5bf91b21340af7b163
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Mon Aug 8 22:55:51 2022 +0800

    tools/power/x86/intel-speed-select: Abstract clos_get_assoc_status

    Allow platform specific implementation to get per core CLOS setting.

    No functional changes are expected.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:46 -04:00
David Arcari a0dfbaf99d tools/power/x86/intel-speed-select: Abstract set_clos
Bugzilla: https://bugzilla.redhat.com/2177018

commit 33dbf360db5fbc09ea1d4962a964d57b5f6004f8
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Mon Aug 8 22:53:48 2022 +0800

    tools/power/x86/intel-speed-select: Abstract set_clos

    Allow platform specific implementation to set CLOS priority setting.

    No functional changes are expected.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:46 -04:00
David Arcari 7f4a4c80ba tools/power/x86/intel-speed-select: Abstract pm_get_clos
Bugzilla: https://bugzilla.redhat.com/2177018

commit 43314e798c92b93b6f899c4dc9e027652990bdbc
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Mon Aug 8 22:50:28 2022 +0800

    tools/power/x86/intel-speed-select: Abstract pm_get_clos

    Allow platform specific implementation to get CLOS priority setting.

    No functional changes are expected.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:46 -04:00
David Arcari 63f024408d tools/power/x86/intel-speed-select: Abstract pm_qos_config
Bugzilla: https://bugzilla.redhat.com/2177018

commit 904d2baa8b04691613a5e1e94061f99f0db2832c
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Mon Aug 8 22:46:57 2022 +0800

    tools/power/x86/intel-speed-select: Abstract pm_qos_config

    Allow platform specific implementation to set CLOS config settings.

    No functional changes are expected.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:46 -04:00
David Arcari 4cb4ba570e tools/power/x86/intel-speed-select: Abstract get_get_trls
Bugzilla: https://bugzilla.redhat.com/2177018

commit 4a17b29188734f6ec4d9835d74a7489e3409c692
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Tue Aug 9 01:52:11 2022 +0800

    tools/power/x86/intel-speed-select: Abstract get_get_trls

    Allow platform specific implementation to get turbo ratio limits of each
    AVX level, for a selected SST-PP level.

    No functional changes are expected.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:45 -04:00
David Arcari 9920c1a091 tools/power/x86/intel-speed-select: Enhance get_tdp_info
Bugzilla: https://bugzilla.redhat.com/2177018

commit 855932831511eef31b5e71c3b6155fd8c57e2a0b
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Thu Feb 2 14:14:54 2023 +0800

    tools/power/x86/intel-speed-select: Enhance get_tdp_info

    mbox_get_uncore_p0_p1_info/get_p1_info/get_uncore_mem_freq can be done
    inside get_tdp_info().

    Fold the code into get_tdp_info().

    No functional changes are expected.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:45 -04:00
David Arcari de50dfa3ac tools/power/x86/intel-speed-select: Abstract get_clos_information
Bugzilla: https://bugzilla.redhat.com/2177018

commit a07bdb81c1434f41eb444e51c2a4028ca2d21b30
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Mon Aug 8 22:42:47 2022 +0800

    tools/power/x86/intel-speed-select: Abstract get_clos_information

    Allow platform specific implementation to get CLOS config setting.

    No functional changes are expected.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:45 -04:00
David Arcari ef6c7b78b9 tools/power/x86/intel-speed-select: Abstract get_uncore_p0_p1_info
Bugzilla: https://bugzilla.redhat.com/2177018

commit 00c26c1f7e3dfc0ec2e39deb1cffc2acad1d2ae4
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Thu Aug 18 00:28:41 2022 +0800

    tools/power/x86/intel-speed-select: Abstract get_uncore_p0_p1_info

    Allow platform specific implementation to get uncore frequency info.

    No functional changes are expected.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:45 -04:00
David Arcari ce6f457c2d tools/power/x86/intel-speed-select: Abstract get_fact_info
Bugzilla: https://bugzilla.redhat.com/2177018

commit 7b5f586dcfdf94dad72a7f3569c100087b80a9ac
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Mon Aug 8 21:52:17 2022 +0800

    tools/power/x86/intel-speed-select: Abstract get_fact_info

    Allow platform specific implementation to get SST-TF info.

    No functional changes are expected.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:45 -04:00
David Arcari 39139582b5 tools/power/x86/intel-speed-select: Abstract set_pbf_fact_status
Bugzilla: https://bugzilla.redhat.com/2177018

commit 5843f2177058dab4d656fee692a0e8a2370e2d3d
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Mon Aug 8 21:44:04 2022 +0800

    tools/power/x86/intel-speed-select: Abstract set_pbf_fact_status

    Allow platform specific implementation to enable/disable SST-TF/BF.

    No functional changes are expected.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:45 -04:00
David Arcari 8e7e2c90be tools/power/x86/intel-speed-select: Remove isst_get_pbf_info_complete
Bugzilla: https://bugzilla.redhat.com/2177018

commit 05ece6916e9a302f0d1eae1744ab72946f9ff32c
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Mon Aug 8 21:37:23 2022 +0800

    tools/power/x86/intel-speed-select: Remove isst_get_pbf_info_complete

    isst_get_pbf_info_complete does nothing but just free the core_mask.
    Remove the function and do free core_mask directly and free core mask in
    the caller.

    No functional changes are expected.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:45 -04:00
David Arcari 709a126d1f tools/power/x86/intel-speed-select: Abstract get_pbf_info
Bugzilla: https://bugzilla.redhat.com/2177018

commit 7a1962904fe459d4763c6e02cd4b3ea503328a11
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Mon Aug 8 21:13:59 2022 +0800

    tools/power/x86/intel-speed-select: Abstract get_pbf_info

    Allow platform specific implementation to get SST-BF information.

    No functional changes are expected.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:45 -04:00
David Arcari cd28eb9c5a tools/power/x86/intel-speed-select: Abstract set_tdp_level
Bugzilla: https://bugzilla.redhat.com/2177018

commit f88c3c4bd431a81e50e126342f8daa6ee9171b82
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Tue Aug 9 01:49:48 2022 +0800

    tools/power/x86/intel-speed-select: Abstract set_tdp_level

    Allow platform specific implementation to set a SST-PP level.

    No functional changes are expected.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:45 -04:00
David Arcari e77add7718 tools/power/x86/intel-speed-select: Abstract get_trl_bucket_info
Bugzilla: https://bugzilla.redhat.com/2177018

commit 1e37f1b21c7022f1d9dd641a6f2d4ffd2950202c
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Mon Aug 8 21:01:08 2022 +0800

    tools/power/x86/intel-speed-select: Abstract get_trl_bucket_info

    Allow platform specific implementation to get buckets info.

    No functional changes are expected.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:45 -04:00
David Arcari c480df7ecc tools/power/x86/intel-speed-select: Abstract get_get_trl
Bugzilla: https://bugzilla.redhat.com/2177018

commit 39f768c341fa429bf9d37f477902aaf0f5aa904f
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Wed Aug 17 23:19:15 2022 +0800

    tools/power/x86/intel-speed-select: Abstract get_get_trl

    Allow platform specific implementation to get turbo ratio limit of the
    selected SST-PP level, and AVX level.

    No functional changes are expected.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:45 -04:00
David Arcari 9aee55827a tools/power/x86/intel-speed-select: Abstract get_coremask_info
Bugzilla: https://bugzilla.redhat.com/2177018

commit 668cc16cc8a0b7e3d7f2f2acff2ca3214fbe38d7
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Tue Aug 9 00:34:34 2022 +0800

    tools/power/x86/intel-speed-select: Abstract get_coremask_info

    Allow platform specific implementation to get the core mask for a given
    SST-PP level.

    No functional changes are expected.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:45 -04:00
David Arcari 2961f9b0af tools/power/x86/intel-speed-select: Abstract get_tjmax_info
Bugzilla: https://bugzilla.redhat.com/2177018

commit a30cbd2270865136fbdcf0fbf7fadda707f32bba
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Mon Aug 8 20:52:23 2022 +0800

    tools/power/x86/intel-speed-select: Abstract get_tjmax_info

    Allow platform specific implementation to get the Tjmax info for a
    given SST-PP level.

    No functional changes are expected.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:45 -04:00
David Arcari 297a21f424 tools/power/x86/intel-speed-select: Move code right before its caller
Bugzilla: https://bugzilla.redhat.com/2177018

commit e4cbd0f13f9ab3b3aefe79c45ab4d01984c37551
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Mon Aug 8 20:49:08 2022 +0800

    tools/power/x86/intel-speed-select: Move code right before its caller

    Some functions are defined far from its only caller.
    Rearrange the code.

    No functional changes are expected.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:45 -04:00
David Arcari 1ea80d2c56 tools/power/x86/intel-speed-select: Abstract get_pwr_info
Bugzilla: https://bugzilla.redhat.com/2177018

commit e107dec9a8ddd97488e579f1d0cf10a849037cdf
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Mon Aug 8 20:34:45 2022 +0800

    tools/power/x86/intel-speed-select: Abstract get_pwr_info

    Allow platform specific implementation to get min and max power for a
    given SST-PP level.

    No functional changes are expected.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:44 -04:00
David Arcari ed51f1c543 tools/power/x86/intel-speed-select: Abstract get_tdp_info
Bugzilla: https://bugzilla.redhat.com/2177018

commit 645b66054cb588c4aa47920643372dd6879ef3b4
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Mon Aug 8 20:31:38 2022 +0800

    tools/power/x86/intel-speed-select: Abstract get_tdp_info

    Allow platform specific implementation to get TDP information.

    No functional changes are expected.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:44 -04:00
David Arcari e257b2aa1e tools/power/x86/intel-speed-select: Abstract get_ctdp_control
Bugzilla: https://bugzilla.redhat.com/2177018

commit bbe32d87524b7b3fe7f758b3f789af4d8997c271
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Mon Aug 8 20:28:06 2022 +0800

    tools/power/x86/intel-speed-select: Abstract get_ctdp_control

    Allow platform specific implementation to get SST-TF/BF/CP capabilities
    and status.

    No functional changes are expected.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:44 -04:00
David Arcari ce9215b527 tools/power/x86/intel-speed-select: Abstract get_config_levels
Bugzilla: https://bugzilla.redhat.com/2177018

commit 724387448a45346768ca23ea92b99c67c89b82c8
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Mon Aug 8 20:23:26 2022 +0800

    tools/power/x86/intel-speed-select: Abstract get_config_levels

    Allow platform specific implementation to get SST-PP level.

    No functional changes are expected.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:44 -04:00
David Arcari fd6eed3e8a tools/power/x86/intel-speed-select: Abstract is_punit_valid
Bugzilla: https://bugzilla.redhat.com/2177018

commit 143584e8484fd5225efc4da490d744d26d2cf64e
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sat Aug 20 19:39:52 2022 +0800

    tools/power/x86/intel-speed-select: Abstract is_punit_valid

    Allow platform specific implementation to identify a valid punit.

    No functional changes are expected.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:44 -04:00
David Arcari 8c0ba02579 tools/power/x86/intel-speed-select: Introduce isst-core-mbox.c
Bugzilla: https://bugzilla.redhat.com/2177018

commit d0d1a603c5fea39ada5d3c48f8b7273a2109af07
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sat Aug 20 18:59:54 2022 +0800

    tools/power/x86/intel-speed-select: Introduce isst-core-mbox.c

    isst-core.c should contain generic core APIs only.
    Platform specific implementations/configurations should be removed from
    this file.

    Introduce isst-core-mbox.c and move all mbox/mmio specific functions to
    this file.

    Introduce struct isst_platform_ops which contains a series of callbacks
    that used by the core APIs but need platform specific implementation.

    No functional changes are expected.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:44 -04:00
David Arcari 1d42bf78be tools/power/x86/intel-speed-select: Always invoke isst_fill_platform_info
Bugzilla: https://bugzilla.redhat.com/2177018

commit e9f79348aedbd1a262bdac0f9e8b104590a30cc0
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sat Aug 20 21:50:53 2022 +0800

    tools/power/x86/intel-speed-select: Always invoke isst_fill_platform_info

    isst_fill_platform_info fills platform specific information.
    And it is the proper place to set platform specific callbacks, as done in
    next patch.

    As the platform specific callbacks are needed in all cases, including
    isst_print_platform_information.

    The best way to achieve both is to invoke isst_fill_platform_info
    unconditionally, and make isst_print_platform_information leverage the
    data already filled.

    No functional changes are expected.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:44 -04:00
David Arcari 0e038a6277 tools/power/x86/intel-speed-select: Introduce isst_get_disp_freq_multiplier
Bugzilla: https://bugzilla.redhat.com/2177018

commit 13b868f8928c947cbf51d167f1727c446beb9933
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sat Aug 20 18:44:59 2022 +0800

    tools/power/x86/intel-speed-select: Introduce isst_get_disp_freq_multiplier

    Remove hardcoded DISP_FREQ_MULTIPLIER in the code and use
    isst_get_disp_freq_multiplier() instead.

    No functional changes are expected.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:44 -04:00
David Arcari 1a2a659855 tools/power/x86/intel-speed-select: Move mbox functions to isst-core.c
Bugzilla: https://bugzilla.redhat.com/2177018

commit 2042c0abf050ce9de508c9efda891de496240708
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sat Aug 20 18:38:11 2022 +0800

    tools/power/x86/intel-speed-select: Move mbox functions to isst-core.c

    isst-config.c should only contain generic code.
    Move mbox functions which are platform specific code to isst-core.c.

    As there are some platform specific parameters set via generic
    application options, introduce isst_update_platform_param to pass these
    parameters to platform specific code.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:44 -04:00
David Arcari e2b79c7f44 tools/power/x86/intel-speed-select: Introduce support for multi-punit
Bugzilla: https://bugzilla.redhat.com/2177018

commit b4edf3854a01fefe2eb2b4bb329ab97aaec5d5f5
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Thu Aug 18 01:06:45 2022 +0800

    tools/power/x86/intel-speed-select: Introduce support for multi-punit

    New platforms may have more than 1 punit in a Package/Die, thus it can
    have multiple power domains in a Package/Die. Package id and die id is not
    sufficient to refer to a specific Power domain.

    Introduce support for multi-punit per package/die.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:44 -04:00
David Arcari 69c36c02df tools/power/x86/intel-speed-select: Improve isst_print_extended_platform_info
Bugzilla: https://bugzilla.redhat.com/2177018

commit ad7e17fcb1261a4445f973369b610c972098e87f
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Wed Aug 17 16:11:13 2022 +0800

    tools/power/x86/intel-speed-select: Improve isst_print_extended_platform_info

    The main thing done in isst_print_extended_platform_info is to get the
    isst feature status by checking one of the power domains of the
    platform.

    This can be done using the for_each_online_power_domain_in_set()
    function, which makes the code clean and easier to read.

    No functional changes are expected.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:44 -04:00
David Arcari 2eadaea96a tools/power/x86/intel-speed-select: Rename for_each_online_package_in_set
Bugzilla: https://bugzilla.redhat.com/2177018

commit c77a8d4af68d98d0d83aa68f90041b395213c589
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Wed Aug 17 15:50:43 2022 +0800

    tools/power/x86/intel-speed-select: Rename for_each_online_package_in_set

    for_each_online_package_in_set is actually used to invoke callback for
    each power domain.
    This is not a problem when there is a single power domain within a
    package/die, but it does not reflect the truth in multi-punit case.

    Rename for_each_online_package_in_set to
    for_each_online_power_domain_in_set.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:44 -04:00
David Arcari 48dd89ae2a tools/power/x86/intel-speed-select: Introduce isst_is_punit_valid()
Bugzilla: https://bugzilla.redhat.com/2177018

commit 57ef2436a1759ae9d9b4d1536aed4701bfb4f737
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Wed Aug 17 15:33:23 2022 +0800

    tools/power/x86/intel-speed-select: Introduce isst_is_punit_valid()

    Introduce isst_is_punit_valid() for checking a valid domain.

    For current platforms, it requires a punit 0 in a valid Package/Die.

    No functional changes are expected.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:44 -04:00
David Arcari e083ce9695 tools/power/x86/intel-speed-select: Follow TRL nameing for FACT info
Bugzilla: https://bugzilla.redhat.com/2177018

commit 16c1892080d841e5d4b59295b96ae760b83c0b7f
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sat Aug 20 18:33:01 2022 +0800

    tools/power/x86/intel-speed-select: Follow TRL nameing for FACT info

    SST-TF high priority core count and ratios and low priority core ratios
    are also per TRL level.
    Cleanup the code to follow the same nameing convention as TRL.

    This removes hardcoded TRL level names and variables.

    No functional changes are expected.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:43 -04:00
David Arcari fba86fcbce tools/power/x86/intel-speed-select: Introduce punit to isst_id
Bugzilla: https://bugzilla.redhat.com/2177018

commit e157c8475e7c2d62d7b28983ea81167f3e6a5a57
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Wed Aug 17 14:51:40 2022 +0800

    tools/power/x86/intel-speed-select: Introduce punit to isst_id

    Punit id can also be retrieved from ISST_IF_GET_PHY_ID.

    punit id is unique within a Package/Die, and together with Package id and
    Die id, they can be used to refer to a specific SST power domain.

    For current platforms, Punit id is always Zero. So no functional changes
    are expected for the current platforms.

    While here, prevent issuing IOCTL if the file /dev/isst_interface can't be
    opened.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:43 -04:00
David Arcari fa11fdc4c9 tools/power/x86/intel-speed-select: Unify TRL levels
Bugzilla: https://bugzilla.redhat.com/2177018

commit 7c7e7c0d396b99d5b41d052dbf2b2bddcd5f7f3c
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sat Aug 20 18:11:21 2022 +0800

    tools/power/x86/intel-speed-select: Unify TRL levels

    TRL supports different levels including SSE/AVX2/AVX512.

    Avoid using hardcoded level name and structure fields, so that a loop can
    be used to parse each TRL level instead. This reduces several lines of
    source code.

    No functional changes are expected.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:43 -04:00
David Arcari b51d635e48 Revert "tools/power/x86/intel-speed-select: Support more than 8 sockets."
Bugzilla: https://bugzilla.redhat.com/2177018
Upstream Status: RHEL-only

This reverts commit 036146a55a which
will allow for easier upstream patch application.  The patch will
be reapplied at the correct point in the series, so there is no
loss of functionality.

Signed-off-by: David Arcari <darcari@redhat.com>
2023-09-22 09:01:43 -04:00
Frank Ramsay 036146a55a tools/power/x86/intel-speed-select: Support more than 8 sockets.
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2220976
Upstream Status: RHEL-Only

AUTHOR: Frank Ramsay <frank.ramsay@hpe.com>
Date: Thu, 20 Jul 2023 11:08:03

	MAX_PACKAGE_COUNT limits the intel-speed-select to systems with 8 sockets or fewer.
	On a system with more than 8 sockets intel-speed-select silently ignores everything
	beyond the 8th socket, rendering the tool useless for those systems.

	Increase MAX_PACKAGE_COUNT to support systems with up to 32 sockets.

Signed-off-by: Frank Ramsay <framsay@redhat.com>
2023-07-28 12:33:43 +00:00
Benjamin Tissoires 4fb151e030 pm-graph: sleepgraph: Avoid crashing on binary data in device names
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2166610
Upstream Status: since v6.3
Tested: with the hid-tools test suite and some hardware

commit 6fa7f537351c8fad0e43e9279efe76dbc942bea0
Author: Todd Brandt <todd.e.brandt@linux.intel.com>
Date:   Mon Mar 13 15:26:52 2023 -0700

    pm-graph: sleepgraph: Avoid crashing on binary data in device names

    A regression has occurred in the hid-sensor code where a device
    name string has not been initialized to 0, and ends up without
    a NULL char and is printed with %s. This includes random binary
    data in the device name, which makes its way into the ftrace output
    and ends up crashing sleepgraph because it expects the ftrace output
    to be ASCII only.

    For example: "HID-SENSOR-INT-020b?.39.auto" ends up in ftrace instead
    of "HID-SENSOR-INT-020b.39.auto". It causes this crash in sleepgraph:

      File "/usr/bin/sleepgraph", line 5579, in executeSuspend
        for line in fp:
      File "/usr/lib/python3.10/codecs.py", line 322, in decode
        (result, consumed) = self._buffer_decode(data, self.errors, final)
    UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position
    1568: invalid start byte

    The issue is present in 6.3-rc1 and is described in full here:
    https://bugzilla.kernel.org/show_bug.cgi?id=217169

    A separate fix has been submitted to have this issue repaired, but
    it has also exposed a larger bug in sleepgraph, since nothing should
    make sleepgraph crash. Sleepgraph needs to be able to handle binary
    data showing up in ftrace gracefully.

    Modify the ftrace processing code to treat it as potentially binary
    and to filter out binary data and leave just the ASCII.

    Link: https://bugzilla.kernel.org/show_bug.cgi?id=217169
    Fixes: 98c062e82451 ("HID: hid-sensor-custom: Allow more custom iio sensors")
    Signed-off-by: Todd Brandt <todd.e.brandt@linux.intel.com>
    [ rjw: Subject and changelog edits ]
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2023-06-19 15:43:03 +02:00
Jan Stancek 18cf420589 Merge: Update intel-speed-select driver and tool
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/2593

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2154079
Tested: https://bugzilla.redhat.com/show_bug.cgi?id=2154079#c7

Signed-off-by: David Arcari <darcari@redhat.com>

Approved-by: Prarit Bhargava <prarit@redhat.com>
Approved-by: Steve Best <sbest@redhat.com>

Signed-off-by: Jan Stancek <jstancek@redhat.com>
2023-06-16 14:38:20 +02:00
Jan Stancek 2fbefe2aa0 Merge: update ACPI to match Linux v6.3
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/2169

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2176554

Signed-off-by: Mark Langsdorf <mlangsdo@redhat.com>

Approved-by: Prarit Bhargava <prarit@redhat.com>
Approved-by: Eric Chanudet <echanude@redhat.com>
Approved-by: David Arcari <darcari@redhat.com>

Signed-off-by: Jan Stancek <jstancek@redhat.com>
2023-06-01 07:25:58 +02:00
Jan Stancek 1f1f936884 Merge: tools/power/x86/intel-speed-select: Add Emerald Rapid quirk
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/2204

Bugzilla: https://bugzilla.redhat.com/2162165
Tested: https://bugzilla.redhat.com/show_bug.cgi?id=2162165#c5

commit 61f9fdcdcd01f9a996b6db4e7092fcdfe8414ad5
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Wed Aug 24 15:44:42 2022 +0800

    tools/power/x86/intel-speed-select: Add Emerald Rapid quirk

    Need memory frequency quirk as Sapphire Rapids in Emerald Rapids.
    So add Emerald Rapids CPU model check in is_spr_platform().

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: Subject, changelog and code edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>

Approved-by: Dean Nelson <dnelson@redhat.com>
Approved-by: Steve Best <sbest@redhat.com>
Approved-by: Prarit Bhargava <prarit@redhat.com>

Signed-off-by: Jan Stancek <jstancek@redhat.com>
2023-05-25 17:52:26 +02:00
David Arcari a1b40a6ac0 tools/power/x86/intel-speed-select: v1.14 release
Bugzilla: https://bugzilla.redhat.com/2154079

commit d1fcb7493fc36a192b19fb8b046c416d05b6d6fe
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Tue Jan 17 14:40:34 2023 -0800

    tools/power/x86/intel-speed-select: v1.14 release

    This release adds following change:
    - Minor fixes for coverity static analysis
    - Don't read cpufreq on offline CPUs
    - SST turbo-freq enable on auto mode when user disables SMT from
    kernel command line
    - Fix uncore frequency display
    - Set uncore frequency max/min limits on perf level change

    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-05-24 15:21:56 -04:00
David Arcari 67164a92a6 tools/power/x86/intel-speed-select: Adjust uncore max/min frequency
Bugzilla: https://bugzilla.redhat.com/2154079

commit 2612ae596129ad9792b9cd5bf5937614edca185f
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Tue Jan 17 14:34:27 2023 -0800

    tools/power/x86/intel-speed-select: Adjust uncore max/min frequency

    When perf level is changed, uncore limits can change. Set the uncore
    limits via Linux uncore sysfs, when user changes perf level with
    -o option.

    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-05-24 15:21:56 -04:00
David Arcari cfee471a0d tools/power/x86/intel-speed-select: Fix display of uncore min frequency
Bugzilla: https://bugzilla.redhat.com/2154079

commit 0d5eea3527e4618ee32fce91a5d54638a7f8c411
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Fri Dec 9 11:23:02 2022 -0800

    tools/power/x86/intel-speed-select: Fix display of uncore min frequency

    Uncore P1 is not uncore minmum frequency. This is uncore base frequency.
    Correct display from uncore-frequency-min(MHz)
    to uncore-frequency-base(Mhz).

    To get uncore min frequency use mailbox command
    CONFIG_TDP_GET_RATIO_INFO. Use this mailbox to get uncore frequency
    limits when present.

    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-05-24 15:21:56 -04:00
David Arcari 6dc94bf5af tools/power/x86/intel-speed-select: Add Emerald Rapid quirk
Bugzilla: https://bugzilla.redhat.com/2154079

commit 61f9fdcdcd01f9a996b6db4e7092fcdfe8414ad5
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Wed Aug 24 15:44:42 2022 +0800

    tools/power/x86/intel-speed-select: Add Emerald Rapid quirk

    Need memory frequency quirk as Sapphire Rapids in Emerald Rapids.
    So add Emerald Rapids CPU model check in is_spr_platform().

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: Subject, changelog and code edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-05-24 15:21:56 -04:00
David Arcari cb18eb3fe9 tools/power/x86/intel-speed-select: turbo-freq auto mode with SMT off
Bugzilla: https://bugzilla.redhat.com/2154079

commit 6ed9e363157cb858bdbb8c595f04839d3f245414
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Fri Jan 6 17:48:07 2023 -0800

    tools/power/x86/intel-speed-select: turbo-freq auto mode with SMT off

    When SMT is disabled from kernel command line, sibling CPUs still
    appears in the sysfs as offline CPUs. This is a problem when turbo-freq
    is enabled in auto mode. They are still assigned to CLOS value
    of 3 as they are still in the present CPU list. But they are not in the
    sibling list of a CPU. When the CPU is a high priority CPU, because of
    sibling it will be still set to CLOS to 3 as CLOS is assigned at core
    level not at CPU level.

    So, avoid setting CLOS 3 to offline CPU.

    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-05-24 15:21:56 -04:00
David Arcari 9c486354a0 tools/power/x86/intel-speed-select: cpufreq reads on offline CPUs
Bugzilla: https://bugzilla.redhat.com/2154079

commit cf3b8e8f55e1a6c747e89599695fb8783c8a69c2
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Fri Jan 6 17:44:26 2023 -0800

    tools/power/x86/intel-speed-select: cpufreq reads on offline CPUs

    Due to some recent kernel changes, reading cpufreq attributes like
    scaling_max_freq on offline CPUs returns error. So avoid reading
    cpufreq attributes on offline CPUs.

    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-05-24 15:21:56 -04:00
David Arcari 96e11fedc8 tools/power/x86/intel-speed-select: Use null-terminated string
Bugzilla: https://bugzilla.redhat.com/2154079

commit 689dfc9e40036cb74f30c0700905b44b2c935846
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Thu Jan 12 14:43:37 2023 +0800

    tools/power/x86/intel-speed-select: Use null-terminated string

    strlen() and strtok() takes null-termimated strings as input.
    Make sure these strings are null-terminated before using them.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-05-24 15:21:56 -04:00
David Arcari fb71cd4382 tools/power/x86/intel-speed-select: Remove duplicate dup()
Bugzilla: https://bugzilla.redhat.com/2154079

commit 8a44d27542cd84352c69e37deaafb8b8976f21a0
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Thu Jan 12 14:43:36 2023 +0800

    tools/power/x86/intel-speed-select: Remove duplicate dup()

    Remove the duplicate dup() invocation.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-05-24 15:21:56 -04:00
David Arcari b0fa1478ac tools/power/x86/intel-speed-select: Handle open() failure case
Bugzilla: https://bugzilla.redhat.com/2154079

commit 364ba3b7115087ab8960473a94cedc7336f345e2
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Thu Jan 12 14:43:35 2023 +0800

    tools/power/x86/intel-speed-select: Handle open() failure case

    Add handling for open() failure case to make sure a valid file
    descriptor is passed to dup().

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-05-24 15:21:56 -04:00
David Arcari 3cf20e47e4 tools/power/x86/intel-speed-select: Remove unused non_block flag
Bugzilla: https://bugzilla.redhat.com/2154079

commit b8bebc8e58d5dc8f2c528b0be4e858959c48e340
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Thu Jan 12 14:43:34 2023 +0800

    tools/power/x86/intel-speed-select: Remove unused non_block flag

    variable 'non_block' is always 0, thus remove the variable and the
    handling for "non_block != 0" case.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-05-24 15:21:56 -04:00
David Arcari f63ad47bb2 tools/power/x86/intel-speed-select: Remove wrong check in set_isst_id()
Bugzilla: https://bugzilla.redhat.com/2154079

commit 507fa17a6c46c111f6b0d2bc483c1b3563fd16c5
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Thu Jan 12 14:43:33 2023 +0800

    tools/power/x86/intel-speed-select: Remove wrong check in set_isst_id()

    struct isst_id *id is a pointer, comparing it with less than zero is wrong.

    The check is there to make sure the id->pkg and id->die is set to -1, when
    it is illegal or unavailable. Here comparing with MAX_PACKAGE_COUNT and
    MAX_DIE_PER_PACKAGE is sufficient.

    Hence remove the wrong check.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: Subject and changelog edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-05-24 15:21:55 -04:00
David Arcari 578fc61c60 tools/power/x86/intel-speed-select: Release v1.13
Bugzilla: https://bugzilla.redhat.com/2154079

commit 97ec890d070158f15fe8ef2419a5ff677bdbbc20
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Thu Sep 15 10:43:44 2022 -0700

    tools/power/x86/intel-speed-select: Release v1.13

    Update version number.

    This version includes fixes for:
    - fix build failure when using gcc options -Wl,--as-needed
    - Fix warning for perf_cap.cpu may be uninitialized
    - Fix off by one check for MAX_DIE_PER_PACKAGE
    - Fix issue with use of get_physical_die_id instead of
    get_physical_die_id

    Optimizations:
    - Removed unused interfaces and functions
    - Better handle package, die, cpu combination by
    defining a struct and set at one place instead
    at each user level.

    New functional change:
    - Warn if turbo is disabled and SST turbo-freq feature is requested

    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-05-24 15:21:55 -04:00
David Arcari cd5d17622a tools/power/x86/intel-speed-select: Optimize CPU initialization
Bugzilla: https://bugzilla.redhat.com/2154079

commit 921604b409cc52d7f5196721ae07b54275e5ebe2
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sat Aug 20 23:58:27 2022 +0800

    tools/power/x86/intel-speed-select: Optimize CPU initialization

    Optimize CPU initialization.
    Do cpu related initialization in one function, including setting the cpu
    present_cpumask, target_cpumask, and cpu_map and core_count arrays.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-05-24 15:21:55 -04:00
David Arcari 69353883bc tools/power/x86/intel-speed-select: Utilize cpu_map to get physical id
Bugzilla: https://bugzilla.redhat.com/2154079

commit ca56725d78c5241f65cc565e5a865f45d943dc04
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sat Aug 20 23:58:26 2022 +0800

    tools/power/x86/intel-speed-select: Utilize cpu_map to get physical id

    cpu_map already has the cpu package id, die id information.
    Thus there is no need to re-evaluating sysfs attributes or stored data
    file to get the package id and die id of a given CPU each time.

    In order to unitlize this, cpu_map needs to be created unconditionally.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-05-24 15:21:55 -04:00
David Arcari 00c41ab805 tools/power/x86/intel-speed-select: Remove unused struct clos_config fields
Bugzilla: https://bugzilla.redhat.com/2154079

commit a05b925ace3ea977fdadb32c969c22ef51029ee7
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sat Aug 20 23:58:25 2022 +0800

    tools/power/x86/intel-speed-select: Remove unused struct clos_config fields

    pkg_id/die_id can be retrieved from struct isst_id, remove the redundant
    clos_config->pkg_id/die_id fields.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-05-24 15:21:55 -04:00
David Arcari e17a1a9980 tools/power/x86/intel-speed-select: Enforce isst_id value
Bugzilla: https://bugzilla.redhat.com/2154079

commit 3ba6a27566a53030b3013f9f841ba5889a344cb8
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sat Aug 20 23:58:24 2022 +0800

    tools/power/x86/intel-speed-select: Enforce isst_id value

    Enforce the pkg/die value in struct isst_id are either -1 or a valid
    value.

    This helps avoid inconsistent or redundant checks.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-05-24 15:21:55 -04:00
David Arcari 48d98307d7 tools/power/x86/intel-speed-select: Do not export get_physical_id
Bugzilla: https://bugzilla.redhat.com/2154079

commit e616059ee6830242ffc68adc91a5486ac957dc1b
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sat Aug 20 23:58:23 2022 +0800

    tools/power/x86/intel-speed-select: Do not export get_physical_id

    Now, all the get_physical_pkg/die/core_id() users are inside
    isst-config.c, so no need to export these APIs.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-05-24 15:21:55 -04:00
David Arcari c991a3ffa7 tools/power/x86/intel-speed-select: Introduce is_cpu_in_power_domain helper
Bugzilla: https://bugzilla.redhat.com/2154079

commit 00bb07db5a42c91f4a74e836c6ae70fff20f7f8a
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sat Aug 20 23:58:22 2022 +0800

    tools/power/x86/intel-speed-select: Introduce is_cpu_in_power_domain helper

    struct isst_id contains cpu, package and die info, and it can represent
    a specific SST power domain.

    Introduce is_cpu_in_power_domain() helper to identify if a cpu is in a
    specified power_domain.

    And cleanup the code to use the new helper.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-05-24 15:21:55 -04:00
David Arcari 348904ed69 tools/power/x86/intel-speed-select: Cleanup get_physical_id usage
Bugzilla: https://bugzilla.redhat.com/2154079

commit 56d6469291f8b1e1ab2f78e401c564163d3ee0f0
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sat Aug 20 23:58:21 2022 +0800

    tools/power/x86/intel-speed-select: Cleanup get_physical_id usage

    struct isst_id already contains package and die id information, thus
    there is no need to get the package and die id information, when struct
    isst_id is already available.

    Remove unneeded get_physical_package_id/get_physical_die_id usage.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-05-24 15:21:55 -04:00
David Arcari 22ffd3641f tools/power/x86/intel-speed-select: Convert more function to use isst_id
Bugzilla: https://bugzilla.redhat.com/2154079

commit 30e0600e2f849434e9a86824e2eced6a6c534723
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sat Aug 20 23:58:20 2022 +0800

    tools/power/x86/intel-speed-select: Convert more function to use isst_id

    With pkg and die info added into struct isst_id, more functions can
    be converted to use struct isst_id as parameter.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-05-24 15:21:55 -04:00
David Arcari 630aafcece tools/power/x86/intel-speed-select: Add pkg and die in isst_id
Bugzilla: https://bugzilla.redhat.com/2154079

commit 32d6ab45511c65e64202bc0b436301fc8ee83ad8
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sat Aug 20 23:58:19 2022 +0800

    tools/power/x86/intel-speed-select: Add pkg and die in isst_id

    Code uses pkg_id and die_id to refer to a specific power domain.

    The pkg/die information is already settled at start time. Adding package
    id and die id information into struct isst_id so that code does not need
    to retrieve them at runtime.

    More code cleanups can be done with the package/die info available.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-05-24 15:21:54 -04:00
David Arcari e039cd6e00 tools/power/x86/intel-speed-select: Introduce struct isst_id
Bugzilla: https://bugzilla.redhat.com/2154079

commit 850337ec7b2c0f510772eeeef9c12c658b3f3603
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sat Aug 20 23:58:18 2022 +0800

    tools/power/x86/intel-speed-select: Introduce struct isst_id

    SST control is power-domain based rather than cpu based, on all the
    systems including Sapphire Rapids and ealier.

    SST core APIs uses cpu id as parameter, and use the underlying pkg_id and
    die_id information to find a power domain, this is not straight forward
    and introduces obscure logics in the code.

    Introduce struct isst_id to represent a SST Power Domain.

    All core APIs are converted to use struct isst_id as parameter instead of
    using cpu id.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-05-24 15:21:54 -04:00
David Arcari 7d51f28346 tools/power/x86/intel-speed-select: Remove unused core_mask array
Bugzilla: https://bugzilla.redhat.com/2154079

commit e278336912423834614191e32e9fbd239e320090
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sat Aug 20 23:58:17 2022 +0800

    tools/power/x86/intel-speed-select: Remove unused core_mask array

    Remove unused core_mask array.

    Reviewed-by: Ira Weiny <ira.weiny@intel.com>
    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-05-24 15:21:54 -04:00
David Arcari dca077d72e tools/power/x86/intel-speed-select: Remove dead code
Bugzilla: https://bugzilla.redhat.com/2154079

commit 190ba96541a3f8f5caa3af41df63af756e43424d
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sat Aug 20 23:58:16 2022 +0800

    tools/power/x86/intel-speed-select: Remove dead code

    Remove dead code.

    Not functional change in this patch

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-05-24 15:21:54 -04:00
David Arcari 9467b2e24b tools/power/x86/intel-speed-select: Fix cpu count for TDP level display
Bugzilla: https://bugzilla.redhat.com/2154079

commit 09db040339847c39a64bce6c06351c1f4a571cc2
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sat Aug 20 23:58:15 2022 +0800

    tools/power/x86/intel-speed-select: Fix cpu count for TDP level display

    In the function isst_ctdp_display_information(), call to the function
    get_cpu_count() is using get_physical_die_id() instead of
    get_physical_package_id(). This will result in wrong display of
    CPU count in that level.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [ Srinivas Pandruvada: fixed subject and change log ]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-05-24 15:21:54 -04:00
David Arcari fc6c983581 tools/power/x86/intel-speed-select: Remove unneeded semicolon
Bugzilla: https://bugzilla.redhat.com/2154079

commit c55ae10230a719020d8ad5a221cbe347d5225157
Author: Xin Gao <gaoxin@cdjrlc.com>
Date:   Mon Jul 18 20:49:07 2022 +0800

    tools/power/x86/intel-speed-select: Remove unneeded semicolon

    Remove an unneeded semicolon.

    Signed-off-by: Xin Gao <gaoxin@cdjrlc.com>
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-05-24 15:21:54 -04:00
David Arcari c81b0f41ad tools/power/x86/intel-speed-select: Fix off by one check
Bugzilla: https://bugzilla.redhat.com/2154079

commit d9f74d98bbec978edbf860f729b531281ba0d8ff
Author: Dan Carpenter <error27@gmail.com>
Date:   Mon Jul 18 16:17:17 2022 +0300

    tools/power/x86/intel-speed-select: Fix off by one check

    Change > MAX_DIE_PER_PACKAGE to >= MAX_DIE_PER_PACKAGE to prevent
    accessing one element beyond the end of the array.

    Fixes: 7fd786dfbd2c ("tools/power/x86/intel-speed-select: OOB daemon mode")
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-05-24 15:21:54 -04:00
David Arcari 6fe05ee6a5 tools/power/x86/intel-speed-select: Fix warning for perf_cap.cpu
Bugzilla: https://bugzilla.redhat.com/2154079

commit 9230a2ac2b47c443e3f0be512d439e811356fab2
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Wed May 11 10:12:08 2022 -0700

    tools/power/x86/intel-speed-select: Fix warning for perf_cap.cpu

    Initialize perf_cap struct to avoid warning:

      CC      hfi-events.o
    In function ‘process_hfi_event’,
        inlined from ‘handle_event’ at hfi-events.c:220:5:
    hfi-events.c:184:9: warning: ‘perf_cap.cpu’ may be used
    uninitialized [-Wmaybe-uninitialized]
      184 |         process_level_change(perf_cap->cpu);
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    hfi-events.c: In function ‘handle_event’:
    hfi-events.c:193:25: note: ‘perf_cap.cpu’ was declared here
      193 |         struct perf_cap perf_cap;
          |                         ^~~~~~~~

    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Link: https://lore.kernel.org/r/20220511171208.211319-1-srinivas.pandruvada@linux.intel.com
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-05-24 15:21:54 -04:00
David Arcari 6f5c5df34c tools/power/x86/intel-speed-select: Display error on turbo mode disabled
Bugzilla: https://bugzilla.redhat.com/2154079

commit 2da6391dfc2aa4c5ef97fe94d2173e87a7bfb534
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Mon May 9 19:34:21 2022 -0700

    tools/power/x86/intel-speed-select: Display error on turbo mode disabled

    For Intel SST turbo-freq feature to be enabled, the turbo mode on the
    platform must be enabled also. If turbo mode is disabled, display error
    while enabling turbo-freq feature.

    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Link: https://lore.kernel.org/r/20220510023421.3930540-1-srinivas.pandruvada@linux.intel.com
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-05-24 15:21:54 -04:00
Mark Langsdorf 6772dd3e39 ACPICA: Add utcksum.o to the acpidump Makefile
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2176554

commit 4f4356e6b4f29129852061987cc036b52deed1c0
Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Date:   Tue Nov 8 14:44:26 2022 +0100

Commit 51aad1a6723b ("ACPICA: Finish support for the CDAT table")
did not add utcksum.o to the acpidump Makefile by mistake.

Do that now.

Fixes: 51aad1a6723b ("ACPICA: Finish support for the CDAT table")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Mark Langsdorf <mlangsdo@redhat.com>
2023-05-18 15:46:36 -04:00
Mark Langsdorf 9dc07d86ab ACPICA: Finish support for the CDAT table
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2176554

commit 51aad1a6723b3ed564d243031c4f284298b4329c
Author: Bob Moore <robert.moore@intel.com>
Date: Thu, 27 Oct 2022 19:58:36 +0200

ACPICA commit 8ac4e5116f59d6f9ba2fbeb9ce22ab58237a278f

Finish support for the CDAT table, in both the data table compiler and
the disassembler.

Link: https://github.com/acpica/acpica/commit/8ac4e511
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Mark Langsdorf <mlangsdo@redhat.com>
2023-05-18 15:46:31 -04:00
David Arcari 8d2c6ee755 tools/power turbostat: update turbostat.8
Bugzilla: https://bugzilla.redhat.com/2185900

commit 7535249d10a889577b5d344e0bd52c28716a6e2f
Author: Len Brown <len.brown@intel.com>
Date:   Thu May 12 21:35:39 2022 -1000

    tools/power turbostat: update turbostat.8

    Update turbostat.8 to reflect new uncore frequency output (UncMHz)
    Also, refresh examples.

    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-04-11 10:42:48 -04:00
David Arcari a1c7510a14 tools/power turbostat: version 2023.03.17
Bugzilla: https://bugzilla.redhat.com/2185900

commit de7839ee02c651335db6bf0af24cf5cac3cc4c72
Author: Len Brown <len.brown@intel.com>
Date:   Fri Mar 17 11:34:10 2023 -0400

    tools/power turbostat: version 2023.03.17

    Happy St. Patrick's Day!

    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-04-11 10:40:03 -04:00
David Arcari 85b0753c80 tools/power turbostat: fix decoding of HWP_STATUS
Bugzilla: https://bugzilla.redhat.com/2185900

commit 92c25393586ac799b9b7d9e50434f3c44a7622c4
Author: Antti Laakso <antti.laakso@intel.com>
Date:   Wed Jan 25 15:17:50 2023 +0200

    tools/power turbostat: fix decoding of HWP_STATUS

    The "excursion to minimum" information is in bit2
    in HWP_STATUS MSR. Fix the bitmask used for
    decoding the register.

    Signed-off-by: Antti Laakso <antti.laakso@intel.com>
    Reviewed-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-04-11 10:40:03 -04:00
David Arcari 29b9025d26 tools/power turbostat: Introduce support for EMR
Bugzilla: https://bugzilla.redhat.com/2185900

commit 93cac4150727dae0ee89f501dd75413b88eedec0
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Wed Jan 4 22:23:53 2023 +0800

    tools/power turbostat: Introduce support for EMR

    Introduce support for EMR.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Reviewed-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
    Tested-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-04-11 10:40:03 -04:00
David Arcari 2e211c4a31 tools/power turbostat: remove stray newlines from warn/warnx strings
Bugzilla: https://bugzilla.redhat.com/2185900

commit 6cbfedc7afc93a7f06d4a2f7c4d4732b20adfc2b
Author: Len Brown <len.brown@intel.com>
Date:   Fri Mar 17 11:25:56 2023 -0400

    tools/power turbostat: remove stray newlines from warn/warnx strings

    warn(3) terminates strings with newlines

    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-04-11 10:40:03 -04:00
David Arcari 82ac2c892f tools/power turbostat: Fix /dev/cpu_dma_latency warnings
Bugzilla: https://bugzilla.redhat.com/2185900

commit 40aafc7d58d3544f152a863a0e9863014b6d5d8c
Author: Prarit Bhargava <prarit@redhat.com>
Date:   Thu Dec 15 10:18:16 2022 -0500

    tools/power turbostat: Fix /dev/cpu_dma_latency warnings

    When running as non-root the following error is seen in turbostat:

    turbostat: fopen /dev/cpu_dma_latency
    : Permission denied

    turbostat and the man page have information on how to avoid other
    permission errors, so these can be fixed the same way.

    Provide better /dev/cpu_dma_latency warnings that provide instructions on
    how to avoid the error, and update the man page.

    Signed-off-by: Prarit Bhargava <prarit@redhat.com>
    Cc: linux-pm@vger.kernel.org
    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-04-11 10:40:03 -04:00
David Arcari 64ab423484 tools/power turbostat: Provide better debug messages for failed capabilities accesses
Bugzilla: https://bugzilla.redhat.com/2185900

commit 9c08581728ccadc6b9e4135b7b8d31948e814f6f
Author: Prarit Bhargava <prarit@redhat.com>
Date:   Tue Oct 18 15:23:37 2022 -0400

    tools/power turbostat: Provide better debug messages for failed capabilities accesses

    turbostat reports some capabilities access errors and not others.  Provide
    the same debug message for all errors.

    [lenb: remove extra quotes]

    Cc: David Arcari <darcari@redhat.com>
    Signed-off-by: Prarit Bhargava <prarit@redhat.com>
    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-04-11 10:40:03 -04:00
David Arcari 96aafa48dd tools/power turbostat: update dump of SECONDARY_TURBO_RATIO_LIMIT
Bugzilla: https://bugzilla.redhat.com/2185900

commit 884a1f956179b561e7e7f1d29fc331cf53233c89
Author: Len Brown <len.brown@intel.com>
Date:   Thu Oct 13 12:42:29 2022 +0200

    tools/power turbostat: update dump of SECONDARY_TURBO_RATIO_LIMIT

    cosmetic only (but useful if you copy/paste)

    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-04-11 10:40:03 -04:00
David Arcari 3281232b1d tools/power turbostat: version 2022.10.04
Bugzilla: https://bugzilla.redhat.com/2185900

commit 9992dd777123b052e106eb5633de47148fef502e
Author: Len Brown <len.brown@intel.com>
Date:   Tue Oct 4 23:02:03 2022 +0200

    tools/power turbostat: version 2022.10.04

    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-04-11 10:40:03 -04:00
David Arcari fd37de5cb5 tools/power turbostat: Use standard Energy Unit for SPR Dram RAPL domain
Bugzilla: https://bugzilla.redhat.com/2185900

commit b2d433ae637626d44c9d4a75dd3330cf68fed9de
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sat Sep 24 13:47:38 2022 +0800

    tools/power turbostat: Use standard Energy Unit for SPR Dram RAPL domain

    Intel Xeon servers used to use a fixed energy resolution (15.3uj) for
    Dram RAPL domain. But on SPR, Dram RAPL domain follows the standard
    energy resolution as described in MSR_RAPL_POWER_UNIT.

    Remove the SPR rapl_dram_energy_units quirk.

    Fixes: e7af1ed3fa ("tools/power turbostat: Support additional CPU model numbers")
    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Tested-by: Wang Wendy <wendy.wang@intel.com>
    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-04-11 10:40:02 -04:00
David Arcari 58c1acc2c7 tools/power turbostat: Do not dump TRL if turbo is not supported
Bugzilla: https://bugzilla.redhat.com/2185900

commit 3ea8e52ec94de6cd5e8a9dc7b2ec72a7745b4e47
Author: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Date:   Fri Sep 16 14:59:50 2022 +0300

    tools/power turbostat: Do not dump TRL if turbo is not supported

    Do not dump turbo ratio limits if platform does not support turbo, because it
    is confusing and the TRL MSRs may even include misleading information. And they
    are not supposed to be relied on if turbo is not supported.

    Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-04-11 10:40:02 -04:00
David Arcari 2846db6e4f tools/power/x86/intel-speed-select: Add Emerald Rapid quirk
Bugzilla: https://bugzilla.redhat.com/2162165

commit 61f9fdcdcd01f9a996b6db4e7092fcdfe8414ad5
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Wed Aug 24 15:44:42 2022 +0800

    tools/power/x86/intel-speed-select: Add Emerald Rapid quirk

    Need memory frequency quirk as Sapphire Rapids in Emerald Rapids.
    So add Emerald Rapids CPU model check in is_spr_platform().

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    [srinivas.pandruvada@linux.intel.com: Subject, changelog and code edits]
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-03-20 10:47:15 -04:00
David Arcari 41ffb53f30 tools/power turbostat: Add support for MeteorLake platforms
Bugzilla: https://bugzilla.redhat.com/2153967

commit 8e45a9bf7ac1337f65772901d432b6d811bec67a
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Sat Sep 10 21:15:42 2022 +0800

    tools/power turbostat: Add support for MeteorLake platforms

    Add turbostat support for MeteorLake platforms, which behave the same
    as RaptorLake platforms.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-03-13 07:51:34 -04:00
David Arcari c134a52dae tools/power turbostat: Add support for RPL-S
Bugzilla: https://bugzilla.redhat.com/2159756

commit 9b1c2ecfa02bc2645e6e9d55f0f39bc191991270
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Wed Aug 31 14:49:57 2022 +0800

    tools/power turbostat: Add support for RPL-S

    Add turbostat support for RAPTORLAKE_S platform, which behaves the same
    as RAPTORLAKE and RAPTORLAKE_P platforms.

    RPL-S 601/801 have different CPU ID than the Hybrid ADL-S platforms.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-01-10 14:14:55 -05:00
Frantisek Hrbata f2b708e7b1 Merge: Update objtool to v5.19
Merge conflicts:
-----------------
arch/x86/include/asm/efi.h
        - arch_efi_call_virt() macro
          keep undef of arch_efi_call_virt from HEAD(!1326)
          ed88433ff2 ("efi: Simplify arch_efi_call_virt() macro"), otherwise
          resolve in favour of !1464

tools/perf/Makefile.perf
        - clean target
          keep removal of perf-with-kcore from HEAD(!1361)
          6da6e51e39 ("perf tools: Delete perf-with-kcore.sh script") and
          keep the make cond expr change from !1464
          403009a4d8 ("kbuild: replace $(if A,A,B) with $(or A,B)")

MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/1464

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2121207
Depends: !1351 for partial backport of e27e5bea956c ("x86/ibt, objtool: Add IBT_NOSEAL()")
Depends: !1370 for backport of 44b979fa302c ("x86/mm/64: Improve stack overflow warnings")

This MR seeks to update objtool and related patchsets.  The commits
incorporate patches and fixes from the following upstream patchsets
(some have been previously backported only in partial form):

v5.15:
* [PATCH 1/2] objtool: Check for gelf_update_rel[a] failures

v5.16:
* [PATCH v2 00/24] objtool/x86: noinstr vs PARAVIRT

v5.17:
* [PATCH kcsan 0/29] Kernel Concurrency Sanitizer (KCSAN) updates for v5.17
* [PATCH v2 00/23] x86: Remove anonymous out-of-line fixups
* [PATCH 00/10] Removal of most do_exit calls

v5.18:
* [PATCH v4 00/11] Re-enable ENQCMD and PASID MSR
* [PATCH v4 00/45] x86: Kernel IBT
* [PATCH] kbuild: replace $(if A,A,B) with $(or A,B) in scripts/Makefile.modpost
* [PATCH 0/4] objtool: Fix fallthrough detection for vmlinux
* [PATCH 0/2] objtool: Fix code reloc vs weak symbols
* [PATCH 0/4] objtool: Fixes
* [PATCH 0/6] x86: Various cleanups and fixes

v5.19:
* [PATCH v2 00/25] objtool: Interface overhaul

Omitted-fix: 00db58cf2118 fixes ee1f9d19143 and not this commit (inaccurate Fixed-by tag)
Omitted-fix: b1c45ad53efb fixes ee1f9d19143 and not this commit (inaccurate Fixed-by tag)

Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>

Approved-by: Prarit Bhargava <prarit@redhat.com>
Approved-by: Rafael Aquini <aquini@redhat.com>
Approved-by: David Arcari <darcari@redhat.com>
Approved-by: Phil Auld <pauld@redhat.com>
Approved-by: Waiman Long <longman@redhat.com>

Signed-off-by: Frantisek Hrbata <fhrbata@redhat.com>
2022-11-09 03:13:13 -05:00
Mark Langsdorf 8549ca6e95 ACPICA: Update copyright notices to the year 2022
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2122317

commit 487ea80a2848b7147eede3b73a4ee160c150f567
Author: Bob Moore <robert.moore@intel.com>
Date: Mon, 11 Apr 2022 20:54:22 +0200

ACPICA commit 738d7b0726e6c0458ef93c0a01c0377490888d1e

Affects all source modules and utility signons.

Link: https://github.com/acpica/acpica/commit/738d7b07
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Mark Langsdorf <mlangsdo@redhat.com>
2022-11-01 11:01:31 -04:00
Joe Lawrence 403009a4d8 kbuild: replace $(if A,A,B) with $(or A,B)
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2121207
Conflicts:
	tools/counter/Makefile
	tools/tracing/rtla/Makefile
	- These do not exist in rhel9

commit 5c8166419acf468b5bc3e48f928a040485d3e0c2
Author: Masahiro Yamada <masahiroy@kernel.org>
Date:   Fri Feb 11 14:14:11 2022 +0900

    kbuild: replace $(if A,A,B) with $(or A,B)

    $(or ...) is available since GNU Make 3.81, and useful to shorten the
    code in some places.

    Covert as follows:

      $(if A,A,B)  -->  $(or A,B)

    This patch also converts:

      $(if A, A, B) --> $(or A, B)

    Strictly speaking, the latter is not an equivalent conversion because
    GNU Make keeps spaces after commas; if A is not empty, $(if A, A, B)
    expands to " A", while $(or A, B) expands to "A".

    Anyway, preceding spaces are not significant in the code hunks I touched.

    Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
    Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>

Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
2022-10-27 14:27:59 -04:00
David Arcari aa5e4960e9 tools/power turbostat: version 2022.07.28
Bugzilla: https://bugzilla.redhat.com/2117770

commit 3afe697b74bc6c59f0b9a9c89d5b163db56fd4b1
Author: Len Brown <len.brown@intel.com>
Date:   Thu Jul 28 14:38:55 2022 -0400

    tools/power turbostat: version 2022.07.28

    update version number

    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2022-09-26 12:04:01 -04:00
David Arcari b4f78cd8a7 tools/power turbostat: do not decode ACC for ICX and SPR
Bugzilla: https://bugzilla.redhat.com/2117770

commit 6287e6f0fdd36be4bbde6f539df6ea85eb2476c2
Author: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Date:   Tue Jul 26 18:29:35 2022 +0300

    tools/power turbostat: do not decode ACC for ICX and SPR

    The ACC (automatic C-state conversion) feature was available on Sky Lake and
    Cascade Lake Xeons (SKX and CLX), but it is not available on Ice Lake and
    Sapphire Rapids Xeons (ICX and SPR). Therefore, stop decoding it for ICX and
    SPR.

    Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2022-09-26 12:04:01 -04:00
David Arcari a4da72d4d4 tools/power turbostat: fix SPR PC6 limits
Bugzilla: https://bugzilla.redhat.com/2117770

commit 0e4d42af81471ab801e059e1feac8e27547230cf
Author: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Date:   Tue Jul 26 18:29:34 2022 +0300

    tools/power turbostat: fix SPR PC6 limits

    Sapphire Rapids Xeon (SPR) supports 2 flavors of PC6 - PC6N (non-retention) and
    PC6R (retention). Before this patch we used ICX package C-state limits, which
    was wrong, because ICX has only one PC6 flavor. With this patch, we use SKX PC6
    limits for SPR, because they are the same.

    Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2022-09-26 12:04:01 -04:00
David Arcari 8c3fa62644 tools/power turbostat: cleanup 'automatic_cstate_conversion_probe()'
Bugzilla: https://bugzilla.redhat.com/2117770

commit eade39b2bf7f35294a814e62e2f5d8117615f18b
Author: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Date:   Tue Jul 26 18:29:33 2022 +0300

    tools/power turbostat: cleanup 'automatic_cstate_conversion_probe()'

    The 'automatic_cstate_conversion_probe()' function has a too long 'if'
    statement, convert it to a 'switch' statement in order to improve code
    readability a bit.

    Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2022-09-26 12:04:01 -04:00
David Arcari 0a649c8779 tools/power turbostat: separate SPR from ICX
Bugzilla: https://bugzilla.redhat.com/2117770

commit 684e40e99e594e0da1dc1b358fbd51c03c606e75
Author: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Date:   Tue Jul 26 18:29:32 2022 +0300

    tools/power turbostat: separate SPR from ICX

    Before this patch, SPR platform was considered identical to ICX platform. This
    patch separates SPR support from ICX.

    This patch is a preparation for adding SPR-specific package C-state limits
    support.

    Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
    Reviewed-by: Chen Yu <yu.c.chen@intel.com>
    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2022-09-26 12:04:01 -04:00
David Arcari b258b6753a tools/power turbosstat: fix comment
Bugzilla: https://bugzilla.redhat.com/2117770

commit 2db0e5eb9c4843cde76bb118750369ef231254e8
Author: Jiang Jian <jiangjian@cdjrlc.com>
Date:   Tue Jun 21 16:16:17 2022 +0800

    tools/power turbosstat: fix comment

    remove duplicate "the" in comment

    Signed-off-by: Jiang Jian <jiangjian@cdjrlc.com>
    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2022-09-26 12:04:01 -04:00
David Arcari db9ef0a208 tools/power turbostat: Support RAPTORLAKE P
Bugzilla: https://bugzilla.redhat.com/2117770

commit 6f9cf553deb84ca5d390dfe7b23022fecbd838df
Author: George D Sworo <george.d.sworo@intel.com>
Date:   Wed Jun 1 14:49:23 2022 -0700

    tools/power turbostat: Support RAPTORLAKE P

    Add initial support for Raptorlake model

    Signed-off-by: George D Sworo <george.d.sworo@intel.com>
    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2022-09-26 12:04:01 -04:00
David Arcari e3e8edba36 tools/power turbostat: add support for ALDERLAKE_N
Bugzilla: https://bugzilla.redhat.com/2117770

commit 1c1313b50af7300865bcfa5b805122f06aa95422
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Fri May 13 13:02:29 2022 +0800

    tools/power turbostat: add support for ALDERLAKE_N

    Add support for ALDERLAKE_N platform.

    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2022-09-26 12:04:01 -04:00
David Arcari 81488d613a tools/power turbostat: dump secondary Turbo-Ratio-Limit
Bugzilla: https://bugzilla.redhat.com/2117770

commit 4af184ee8b2c0a69a038483ba605510203bf015b
Author: Len Brown <len.brown@intel.com>
Date:   Tue May 31 17:29:13 2022 -1000

    tools/power turbostat: dump secondary Turbo-Ratio-Limit

    Intel Performance Hybrid processors have a 2nd MSR
    describing the turbo limits enforced on the Ecores.

    Note, TRL and Secondary-TRL are usually R/O information,
    but on overclock-capable parts, they can be written.

    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2022-09-26 12:04:01 -04:00
David Arcari a97e6636ac tools/power turbostat: simplify dump_turbo_ratio_limits()
Bugzilla: https://bugzilla.redhat.com/2117770

commit 5d6228452c008d1186e8d6a5ef3079e608e7a888
Author: Len Brown <len.brown@intel.com>
Date:   Tue May 31 17:21:06 2022 -1000

    tools/power turbostat: simplify dump_turbo_ratio_limits()

    code cleanup only.
    no functional change.

    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2022-09-26 12:04:01 -04:00
David Arcari bb2c9308fd tools/power turbostat: dump CPUID.7.EDX.Hybrid
Bugzilla: https://bugzilla.redhat.com/2117770

commit 774627c59848844e4bc46bb45a0d13e3a1b723e9
Author: Len Brown <len.brown@intel.com>
Date:   Tue May 31 17:08:25 2022 -1000

    tools/power turbostat: dump CPUID.7.EDX.Hybrid

    CPUID leaf 7 EDX now tells us if the processor has hybrid CPUs

    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2022-09-26 12:04:01 -04:00
David Arcari 40367c950e tools/power turbostat: Show uncore frequency
Bugzilla: https://bugzilla.redhat.com/2117770

commit a5c6d65d06ebd09251fc3ff43f600d4d70966a4d
Author: Len Brown <len.brown@intel.com>
Date:   Thu May 12 21:35:39 2022 -1000

    tools/power turbostat: Show uncore frequency

    When CONFIG_INTEL_UNCORE_FREQ_CONTROL is effective,
    (Linux 5.9 and later), print the current (and default)
    min and max uncore frequency limits.

    When that driver provides the current uncore frequency
    (Linux 5.18 and later), print a UncMHz column
    reflecting the current uncore frequency.

    Note that UncMHz is an instantaneous sample, not an average.

    eg.

    $ sudo ./turbostat -S --show frequency
    ...
    Uncore Frequency pkg0 die0: 800 - 3900 MHz (800 - 3900 MHz)
    ...
    Avg_MHz Busy%   Bzy_MHz TSC_MHz UncMHz
    28      0.70    4049    3095    3900

    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2022-09-26 12:04:00 -04:00