Commit Graph

1374 Commits

Author SHA1 Message Date
David Arcari 09563751dc tools/power turbostat: Fix unc freq columns not showing with '-q' or '-l'
JIRA: https://issues.redhat.com/browse/RHEL-33321

commit c5120a3356755f9e9d2d592c1347f3b9ff4022a7
Author: Adam Hawley <adam.james.hawley@intel.com>
Date:   Wed May 22 16:27:21 2024 +0300

    tools/power turbostat: Fix unc freq columns not showing with '-q' or '-l'

    Commit 78464d7681f7 ("tools/power turbostat: Add columns for clustered
    uncore frequency") introduced 'probe_intel_uncore_frequency_cluster()'
    in a way which prevents printing uncore frequency columns if either of
    the '-q' or '-l' options are used. Systems which do not have multiple
    uncore frequencies per package are unaffected by this regression.

    Fix the function so that uncore frequency columns are shown when either
    the '-l' or '-q' option is used by checking if 'quiet' is true after
    adding counters for the uncore frequency columns.

    Fixes: 78464d7681f7 ("tools/power turbostat: Add columns for clustered uncore frequency")

    Signed-off-by: Adam Hawley <adam.james.hawley@intel.com>
    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-06-28 13:57:50 -04:00
David Arcari 71ee1bdb3b tools/power turbostat: option '-n' is ambiguous
JIRA: https://issues.redhat.com/browse/RHEL-33321
JIRA: https://issues.redhat.com/browse/RHEL-36084

commit ebb5b260af67c677700cd51be6845c2cab3edfbd
Author: David Arcari <darcari@redhat.com>
Date:   Mon May 20 14:57:49 2024 -0400

    tools/power turbostat: option '-n' is ambiguous

    In some cases specifying the '-n' command line argument will cause
    turbostat to fail.  For instance 'turbostat -n 1' works fine; however,
    'turbostat -n 1 -d' will fail.  This is the result of the first call
    to getopt_long_only() where "MP" is specified as the optstring.  This can
    be easily fixed by changing the optstring from "MP" to "MPn:" to remove
    ambiguity between the arguments.

    tools/power turbostat: option '-n' is ambiguous; possibilities: '-num_iterations' '-no-msr' '-no-perf'

    Fixes: a0e86c90b83c ("tools/power turbostat: Add --no-perf option")

    Signed-off-by: David Arcari <darcari@redhat.com>
    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-06-28 13:57:12 -04:00
David Arcari e4b8a99d4c tools/power turbostat: version 2024.05.10
JIRA: https://issues.redhat.com/browse/RHEL-33321

commit 256d218ec6aea99855dc5c54af550fcff96fc732
Author: Len Brown <len.brown@intel.com>
Date:   Sat Apr 27 22:15:48 2024 -0400

    tools/power turbostat: version 2024.05.10

    New since 2024.04.08:

    Len Brown (6):
          tools/power turbostat: Add "snapshot:" Makefile target
          tools/power turbostat: Harden probe_intel_uncore_frequency()
          tools/power turbostat: Remember global max_die_id
          tools/power turbostat: Survive sparse die_id
          tools/power turbostat: Add columns for clustered uncore frequency
          tools/power turbostat: version 2024.05.10

    Patryk Wlazlyn (7):
          tools/power turbostat: Replace _Static_assert with BUILD_BUG_ON
          tools/power turbostat: Enable non-privileged users to read sysfs counters
          tools/power turbostat: Avoid possible memory corruption due to sparse topology IDs
          tools/power turbostat: Read Core-cstates via perf
          tools/power turbostat: Read Package-cstates via perf
          tools/power turbostat: Fix order of strings in pkg_cstate_limit_strings
          tools/power turbostat: Ignore pkg_cstate_limit when it is not available

    Zhang Rui (2):
          tools/power turbostat: Enhance ARL/LNL support
          tools/power turbostat: Add ARL-H support

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

Signed-off-by: David Arcari <darcari@redhat.com>
2024-06-28 13:55:56 -04:00
David Arcari 9db095f0b6 tools/power turbostat: Ignore pkg_cstate_limit when it is not available
JIRA: https://issues.redhat.com/browse/RHEL-33321

commit 29fea61cd8d4d0e646022c0479aa35381cf1e990
Author: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
Date:   Thu May 9 12:39:47 2024 +0200

    tools/power turbostat: Ignore pkg_cstate_limit when it is not available

    When running in no-msr mode, the pkg_cstate_limit is not populated, thus
    we use perf to determine if given pcstate counter is present on the
    platform.

    Signed-off-by: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-06-28 13:55:44 -04:00
David Arcari daebdcb472 tools/power turbostat: Fix order of strings in pkg_cstate_limit_strings
JIRA: https://issues.redhat.com/browse/RHEL-33321

commit 4e7ee02300805d26d9731fd24c4de8e10a43ffea
Author: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
Date:   Thu May 9 12:24:02 2024 +0200

    tools/power turbostat: Fix order of strings in pkg_cstate_limit_strings

    Change the order so that it matches the indexes defined in:

    Signed-off-by: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-06-28 13:55:37 -04:00
David Arcari c5d0d899ad tools/power turbostat: Read Package-cstates via perf
JIRA: https://issues.redhat.com/browse/RHEL-33321

commit 0451adf4d46d5df91f888a3d010a4109aa23a7ae
Author: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
Date:   Wed May 8 15:00:14 2024 +0200

    tools/power turbostat: Read Package-cstates via perf

    Reading the counters via perf can be done in bulk with a single syscall,
    making the counter values more accurate with respect to one another by
    minimizing the time gap between individual counter reads.

    Signed-off-by: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-06-28 13:55:20 -04:00
David Arcari fe2b5b7385 tools/power turbostat: Read Core-cstates via perf
JIRA: https://issues.redhat.com/browse/RHEL-33321

commit 1f9e46da9cba54d12880948fd2adac31bb0eaadb
Author: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
Date:   Mon Mar 11 18:06:16 2024 +0100

    tools/power turbostat: Read Core-cstates via perf

    Reading the counters via perf can be done in bulk with a single syscall,
    making the counter values more accurate with respect to one another by
    minimizing the time gap between individual counter reads.

    Signed-off-by: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-06-28 13:55:02 -04:00
David Arcari 7ee1ffd433 tools/power turbostat: Avoid possible memory corruption due to sparse topology IDs
JIRA: https://issues.redhat.com/browse/RHEL-33321

commit 3559ea813ad3a9627934325c68ad05b18008a077
Author: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
Date:   Mon May 6 15:39:08 2024 +0200

    tools/power turbostat: Avoid possible memory corruption due to sparse topology IDs

    Save the highest core and package id when parsing topology to
    allocate enough memory when get_rapl_counters() is called with a core or
    a package id as a domain.

    Note that RAPL domains are per-package on Intel, but per-core on AMD.
    Thus, the RAPL code effectively runs in different modes on those two
    product lines.

    Signed-off-by: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-06-28 13:54:53 -04:00
David Arcari a6cf2fb1d2 tools/power turbostat: Add columns for clustered uncore frequency
JIRA: https://issues.redhat.com/browse/RHEL-33321

commit 78464d7681f79bb48995c3d29d7e93d27ba69bca
Author: Len Brown <len.brown@intel.com>
Date:   Wed Apr 24 21:12:18 2024 -0400

    tools/power turbostat: Add columns for clustered uncore frequency

    New machines have multiple uncore frequencies per package,
    visible in /sys/devices/system/cpu/intel_uncore_frequency/uncore##/

    turbostat now samples these frequencies each measurement interval.

    For each package, turbostat now prints "UMHzX.Y" columns,
    where X = domain_id, and Y = fabric_cluster_id.

    The system summary for each UMHzX.Y column is the average value
    for across all of the packages in the system.

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

Signed-off-by: David Arcari <darcari@redhat.com>
2024-06-28 13:54:33 -04:00
David Arcari eccfd4792c tools/power turbostat: Enable non-privileged users to read sysfs counters
JIRA: https://issues.redhat.com/browse/RHEL-33321

commit 0e39702fbbcdb16ad349439065d24a3bb5e2f331
Author: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
Date:   Thu Apr 25 17:54:18 2024 +0200

    tools/power turbostat: Enable non-privileged users to read sysfs counters

    A group of counters called "sysfs" displays software
    C-state request counts and resulting perceived C-state residency.

    They are not built-in counters that turbostat knows about ahead of time,
    rather they are discovered in sysfs when turbostat starts.

    Thus, they are added dynamically, using the same interface
    as user-added MSR counters.

    When turbostat enters "no-msr" mode, such as when running as a
    non-privileged user, it clears all added counters.

    Updating that to clear only actual MSR added counters
    allows regular users to see the sysfs counters.

    [lenb: commit message]

    Signed-off-by: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-06-28 13:54:24 -04:00
David Arcari 1c7e0b6f38 tools/power turbostat: Replace _Static_assert with BUILD_BUG_ON
JIRA: https://issues.redhat.com/browse/RHEL-33321

commit d3e6f6253895f499b63bac261b81732f9efc4902
Author: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
Date:   Tue Apr 23 11:59:49 2024 +0200

    tools/power turbostat: Replace _Static_assert with BUILD_BUG_ON

    So it compiles on GCC older than 9.0.

    Signed-off-by: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-06-28 13:54:11 -04:00
David Arcari 753000cf82 tools/power turbostat: Add ARL-H support
JIRA: https://issues.redhat.com/browse/RHEL-33321

commit f04fcc7ac8ceb87933244cca28759d0fac6103ce
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Wed Mar 27 22:36:38 2024 +0800

    tools/power turbostat: Add ARL-H support

    Add turbostat support for ARL-H, which behaves the same as ARL.

    [lenb: also add ARL-U]

    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>
2024-06-28 13:53:50 -04:00
David Arcari 732ee02756 tools/power turbostat: Enhance ARL/LNL support
JIRA: https://issues.redhat.com/browse/RHEL-33321

commit 196eca020600470ca44da94c65607e7a98aa9d3c
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Wed Mar 27 22:35:03 2024 +0800

    tools/power turbostat: Enhance ARL/LNL support

    ARL/LNL don't have PC8, other than that, it behaves the same as CNL.
    Copy cnl_features for ARL/LNL, except that PC8 support is removed.

    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>
2024-06-28 13:53:41 -04:00
David Arcari fb7a0eb033 tools/power turbostat: Survive sparse die_id
JIRA: https://issues.redhat.com/browse/RHEL-33321

commit c8b246ea2ea5771f2a0ca6f6a9a520406e6b6eb7
Author: Len Brown <len.brown@intel.com>
Date:   Sun Apr 21 12:02:24 2024 -0400

    tools/power turbostat: Survive sparse die_id

    Turbostat assumed that every package had a die_id = 0.
    When this assumption was violated, it exited
    when looking for the package uncore frequency:

    turbostat: /sys/.../intel_uncore_frequency/package_01_die_00/current_freq_khz: open failed: No such file or directory

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

Signed-off-by: David Arcari <darcari@redhat.com>
2024-06-28 13:53:32 -04:00
David Arcari 3c7fe523e1 tools/power turbostat: Remember global max_die_id
JIRA: https://issues.redhat.com/browse/RHEL-33321

commit cda203388687aa075db6f8996c3c4549fa518ea8
Author: Len Brown <len.brown@intel.com>
Date:   Sun Apr 21 11:56:48 2024 -0400

    tools/power turbostat: Remember global max_die_id

    This is necessary to gracefully handle sparse die_id's.

    no functional change

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

Signed-off-by: David Arcari <darcari@redhat.com>
2024-06-28 13:53:19 -04:00
David Arcari 6191d6763e tools/power turbostat: Harden probe_intel_uncore_frequency()
JIRA: https://issues.redhat.com/browse/RHEL-33321

commit ae3326ac5742506409a03ce5d69716a8dba4eabc
Author: Len Brown <len.brown@intel.com>
Date:   Sun Apr 21 14:45:10 2024 -0400

    tools/power turbostat: Harden probe_intel_uncore_frequency()

    If sysfs directory "intel_uncore_frequency/cluster00/" exists,
    then use uncore cluster code (now its own routine).

    The previous check for
    "intel_uncore_frequency/package_00_die_00/current_freq_khz",
    could be unreliable in the face of sparse die id's.

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

Signed-off-by: David Arcari <darcari@redhat.com>
2024-06-28 13:53:11 -04:00
David Arcari ba01ec147e tools/power turbostat: Add "snapshot:" Makefile target
JIRA: https://issues.redhat.com/browse/RHEL-33321

commit 231ce08b662a58d4392da998699b3d4a7e2e87cf
Author: Len Brown <len.brown@intel.com>
Date:   Sun Apr 21 12:53:53 2024 -0400

    tools/power turbostat: Add "snapshot:" Makefile target

    Kernel developers often need to diagnose remote customer systems
    with the latest turbostat, yet customers are running binary distros
    with out-dated turbostat and the customer has no experience
    cloning linux kernel trees.

    Add a turbostat "snapshot" makefile target to create a standalone
    source snapshot from the developer's git tree, appropriately hacked
    so that the customer can build turbostat without a kernel tree.

    Include the turbostat binary in the snapshot, for convenience in
    those situations where the source and destination are trusted,
    (and have new enough glibc to execute).

    The snapshot is named with the date it was taken rather than
    the turbostat VERSION, as it could occur between VERSIONS...

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

Signed-off-by: David Arcari <darcari@redhat.com>
2024-06-28 13:53:04 -04:00
David Arcari 0c10ee3bb5 tools/power/x86/intel-speed-select: v1.19 release
JIRA: https://issues.redhat.com/browse/RHEL-20031

commit 5cfac5abb6e23d15669d0621d991d141f4f9b7d4
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Thu Apr 25 17:36:08 2024 -0700

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

    This version addresses issues with:
    - Support of SST BF/TF support per level
    - Increase number of CPUs displayed
    - Present all TRL levels for turbo-freq
    - Fix display for unsupported levels
    - Support multiple dies
    - Increase die count
    - Change CPU display for non compute domain

    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>
2024-06-25 10:32:52 -04:00
David Arcari 5e5c8c8313 tools/power/x86/intel-speed-select: Display CPU as None for -1
JIRA: https://issues.redhat.com/browse/RHEL-20031

commit 8ebc39ace34e9b9944e29110598f8343f2d8c159
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Fri Apr 26 14:39:44 2024 -0700

    tools/power/x86/intel-speed-select: Display CPU as None for -1

    When there is no CPU in a power domain, display "None" instead of -1.

    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>
2024-06-25 10:32:52 -04:00
David Arcari 5a81841dba tools/power/x86/intel-speed-select: SST BF/TF support per level
JIRA: https://issues.redhat.com/browse/RHEL-20031

commit 1fcf670e50645f23f026d1dca82e59200115f925
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Tue Mar 26 18:55:53 2024 -0400

    tools/power/x86/intel-speed-select: SST BF/TF support per level

    SST BF and TF can be enabled/disabled per level. So check the current
    level support from the mask of supported levels.

    This change from a single level to mask for info.sst_tf_support and
    info.sst_tf_support is indicated by API version change. Use as mask for
    API version above 2. In this way there is no change in behavior when
    running on older kernel with API version 2.

    Since the tool can support now API version 3, update the supported API
    version.

    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>
2024-06-25 10:32:52 -04:00
David Arcari 190a6d01a4 tools/power/x86/intel-speed-select: Increase number of CPUs displayed
JIRA: https://issues.redhat.com/browse/RHEL-20031

commit 80a513e3f7fca0493e2760b2bb0526faa33a12cb
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Mon Mar 25 13:39:36 2024 -0700

    tools/power/x86/intel-speed-select: Increase number of CPUs displayed

    Currently max 128 CPUs can be displayed in the enable CPU list. Double
    the range. Since the size is big for stack allocation, change to static.
    Here changing to static is fine as these functions are called in serial.

    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>
2024-06-25 10:32:52 -04:00
David Arcari e70639d42b tools/power/x86/intel-speed-select: Present all TRL levels for turbo-freq
JIRA: https://issues.redhat.com/browse/RHEL-20031

commit 38fa152b3de09c01e3488debb903adb0a28580b9
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Fri Mar 8 18:11:03 2024 -0800

    tools/power/x86/intel-speed-select: Present all TRL levels for turbo-freq

    For turbo-freq feature, only 3 levels of frequencies are displayed even
    if platform support more. Present all levels based on the CPU model.

    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>
2024-06-25 10:32:52 -04:00
David Arcari 04b50d404a tools/power/x86/intel-speed-select: Fix display for unsupported levels
JIRA: https://issues.redhat.com/browse/RHEL-20031

commit 55d5639bda6563fdfbdf0606c3c23cf5fceacd61
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Fri Mar 8 16:12:33 2024 -0800

    tools/power/x86/intel-speed-select: Fix display for unsupported levels

    During call to "intel-speed-select turbo-freq info" some junk values are
    reported for unsupported levels. Initialize the structure fact_info with
    0s, so that isst_fact_display_information() will skip "0" values in the
    frequency.

    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>
2024-06-25 10:32:51 -04:00
David Arcari 1087adad8b tools/power/x86/intel-speed-select: Support multiple dies
JIRA: https://issues.redhat.com/browse/RHEL-20031

commit f9264471337e1db69ffc97525bff605b8c7c442f
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Thu Mar 7 15:47:11 2024 -0800

    tools/power/x86/intel-speed-select: Support multiple dies

    When the die id is same as punit compute die ID, treat them same. In this
    case, when for_each_online_power_domain_in_set() is called, then don't
    loop for each punit in a die. Just loop for all punits in a package.

    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>
2024-06-25 10:32:51 -04:00
David Arcari 3fe1ffa88d tools/power/x86/intel-speed-select: Increase die count
JIRA: https://issues.redhat.com/browse/RHEL-20031

commit 9ea48bdfd5b19a81edfd9dcc12b8af6bb319c6d8
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Thu Mar 7 15:45:54 2024 -0800

    tools/power/x86/intel-speed-select: Increase die count

    TPMI platform information supports up to 16 compute dies. So increase the
    range.

    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>
2024-06-25 10:32:51 -04:00
David Arcari 3f250e2579 tools/power turbostat: v2024.04.10
JIRA: https://issues.redhat.com/browse/RHEL-34610

commit 3ab7296a7e6aa34634dcc2926af933107a117996
Author: Len Brown <len.brown@intel.com>
Date:   Mon Apr 8 19:32:58 2024 -0400

    tools/power turbostat: v2024.04.10

    Much of turbostat can now run with perf, rather than using the MSR driver

    Some of turbostat can now run as a regular non-root user.

    Add some new output columns for some new GFX hardware.

    [This patch updates the version, but otherwise changes no function;
     it touches up some checkpatch issues from previous patches]

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

Signed-off-by: David Arcari <darcari@redhat.com>
2024-04-27 14:21:59 -04:00
David Arcari 9f2ab174dc tools/power/turbostat: Add support for Xe sysfs knobs
JIRA: https://issues.redhat.com/browse/RHEL-34610

commit 91a91d389543a86963beec148d98d37875154bd4
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Tue Mar 12 23:56:02 2024 +0800

    tools/power/turbostat: Add support for Xe sysfs knobs

    Xe graphics driver uses different graphics sysfs knobs including
       /sys/class/drm/card0/device/tile0/gt0/gtidle/idle_residency_ms
       /sys/class/drm/card0/device/tile0/gt0/freq0/cur_freq
       /sys/class/drm/card0/device/tile0/gt0/freq0/act_freq
       /sys/class/drm/card0/device/tile0/gt1/gtidle/idle_residency_ms
       /sys/class/drm/card0/device/tile0/gt1/freq0/cur_freq
       /sys/class/drm/card0/device/tile0/gt1/freq0/act_freq

    Plus that,
       /sys/class/drm/card0/device/tile0/gt<n>/gtidle/name
    returns either gt<n>-rc or gt<n>-mc. rc is for GFX and mc is SA Media.

    Enhance turbostat to prefer the Xe sysfs knobs when they are available.
    Export gt<n>-rc via BIC_GFX_rc6/BIC_GFXMHz/BIC_GFXACTMHz.
    Export gt<n>-mc via BIC_SMA_mc6/BIC_SMAMHz/BIC_SMAACTMHz.

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

Signed-off-by: David Arcari <darcari@redhat.com>
2024-04-27 14:21:59 -04:00
David Arcari 6d3643c524 tools/power/turbostat: Add support for new i915 sysfs knobs
JIRA: https://issues.redhat.com/browse/RHEL-34610

commit dc02dc937a3ef819c5da10e97084af6977be26bf
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Fri Mar 22 09:52:24 2024 +0800

    tools/power/turbostat: Add support for new i915 sysfs knobs

    On Meteorlake platform, i915 driver supports the traditional graphics
    sysfs knobs including
       /sys/class/drm/card0/power/rc6_residency_ms
       /sys/class/drm/card0/gt_cur_freq_mhz
       /sys/class/drm/card0/gt_act_freq_mhz

    At the same time, it also supports
       /sys/class/drm/card0/gt/gt0/rc6_residency_ms
       /sys/class/drm/card0/gt/gt0/rps_cur_freq_mhz
       /sys/class/drm/card0/gt/gt0/rps_act_freq_mhz
       /sys/class/drm/card0/gt/gt1/rc6_residency_ms
       /sys/class/drm/card0/gt/gt1/rps_cur_freq_mhz
       /sys/class/drm/card0/gt/gt1/rps_act_freq_mhz
    gt0 is for GFX and gt1 is for SA Media.

    Enhance turbostat to prefer the i915 new sysfs knobs.
    Export gt0 via BIC_GFX_rc6/BIC_GFXMHz/BIC_GFXACTMHz.
    Export gt1 via BIC_SMA_mc6/BIC_SMAMHz/BIC_SMAACTMHz.

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

Signed-off-by: David Arcari <darcari@redhat.com>
2024-04-27 14:21:59 -04:00
David Arcari 72f8ad89ef tools/power/turbostat: Introduce BIC_SAM_mc6/BIC_SAMMHz/BIC_SAMACTMHz
JIRA: https://issues.redhat.com/browse/RHEL-34610

commit 3bbb331c1d34fdd5520a050fce35f71579430485
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Wed Mar 13 10:30:04 2024 +0800

    tools/power/turbostat: Introduce BIC_SAM_mc6/BIC_SAMMHz/BIC_SAMACTMHz

    Graphics driver (i915/Xe) on mordern platforms splits GFX and SA Media
    information via different sysfs knobs.

    Existing BIC_GFX_rc6/BIC_GFXMHz/BIC_GFXACTMHz columns can be reused for
    GFX.

    Introduce BIC_SAM_mc6/BIC_SAMMHz/BIC_SAMACTMHz columns for SA Media.

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

Signed-off-by: David Arcari <darcari@redhat.com>
2024-04-27 14:21:59 -04:00
David Arcari 569d22a1dc tools/power/turbostat: Fix uncore frequency file string
JIRA: https://issues.redhat.com/browse/RHEL-34610
JIRA: https://issues.redhat.com/browse/RHEL-29239

commit 60add818ab2543b7e4f2bfeaacf2504743c1eb50
Author: Justin Ernst <justin.ernst@hpe.com>
Date:   Tue Apr 2 13:40:29 2024 -0400

    tools/power/turbostat: Fix uncore frequency file string

    Running turbostat on a 16 socket HPE Scale-up Compute 3200 (SapphireRapids) fails with:
    turbostat: /sys/devices/system/cpu/intel_uncore_frequency/package_010_die_00/current_freq_khz: open failed: No such file or directory

    We observe the sysfs uncore frequency directories named:
    ...
    package_09_die_00/
    package_10_die_00/
    package_11_die_00/
    ...
    package_15_die_00/

    The culprit is an incorrect sprintf format string "package_0%d_die_0%d" used
    with each instance of reading uncore frequency files. uncore-frequency-common.c
    creates the sysfs directory with the format "package_%02d_die_%02d". Once the
    package value reaches double digits, the formats diverge.

    Change each instance of "package_0%d_die_0%d" to "package_%02d_die_%02d".

    [lenb: deleted the probe part of this patch, as it was already fixed]

    Signed-off-by: Justin Ernst <justin.ernst@hpe.com>
    Reviewed-by: Thomas Renninger <trenn@suse.de>
    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-04-27 14:21:41 -04:00
David Arcari 7578b78103 tools/power/turbostat: Unify graphics sysfs snapshots
JIRA: https://issues.redhat.com/browse/RHEL-34610

commit de39d38c06eb047954c5ad20a3f9acb6d3c78498
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Wed Mar 13 10:12:19 2024 +0800

    tools/power/turbostat: Unify graphics sysfs snapshots

    Graphics sysfs snapshots share similar logic.
    Combine them into one function to avoid code duplication.

    No functional change.

    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>
2024-04-27 14:21:33 -04:00
David Arcari f979dacd99 tools/power/turbostat: Cache graphics sysfs path
JIRA: https://issues.redhat.com/browse/RHEL-34610

commit 4e2bbbf78cf7144204214fd0bd7cca309acd8f89
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Tue Mar 12 14:23:37 2024 +0800

    tools/power/turbostat: Cache graphics sysfs path

    Graphics drivers (i915/Xe) have different sysfs knobs on different
    platforms, and it is possible that different sysfs knobs fit into the
    same turbostat columns.

    Instead of specifying different sysfs knobs every time, detect them
    once and cache the path for future use.

    No functional change.

    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>
2024-04-27 14:21:33 -04:00
David Arcari 81fe179a5e tools/power/turbostat: Enable MSR_CORE_C1_RES support for ICX
JIRA: https://issues.redhat.com/browse/RHEL-34610

commit bb5db22c13125b38b0740e19c18ae94f8e5a0eb6
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Tue Mar 12 11:19:15 2024 +0800

    tools/power/turbostat: Enable MSR_CORE_C1_RES support for ICX

    Enable Core C1 hardware residency counter (MSR_CORE_C1_RES) on ICX.

    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>
2024-04-27 14:21:33 -04:00
David Arcari 8e53cb8b52 tools/power turbostat: read RAPL counters via perf
JIRA: https://issues.redhat.com/browse/RHEL-34610

commit 05a2f07db8883b027c0b4a475fcc586278922b8d
Author: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
Date:   Tue Mar 5 12:27:27 2024 +0100

    tools/power turbostat: read RAPL counters via perf

    Some of the future Intel platforms will require reading the RAPL
    counters via perf and not MSR. On current platforms we can still read
    them using both ways.

    Signed-off-by: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-04-27 14:21:33 -04:00
David Arcari c91f8d19bb tools/power turbostat: Add proper re-initialization for perf file descriptors
JIRA: https://issues.redhat.com/browse/RHEL-34610

commit ebf8449caba1df2eb6ba0b465fe15dc06d3b9135
Author: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
Date:   Thu Feb 15 12:50:19 2024 +0100

    tools/power turbostat: Add proper re-initialization for perf file descriptors

    Signed-off-by: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-04-27 14:21:33 -04:00
David Arcari 4b8535b91a tools/power turbostat: Clear added counters when in no-msr mode
JIRA: https://issues.redhat.com/browse/RHEL-34610

commit 4a1bb4dad5d16669e841410944e7bc84ef7263fc
Author: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
Date:   Thu Mar 14 11:36:55 2024 +0100

    tools/power turbostat: Clear added counters when in no-msr mode

    If user request --no-msr or is not able to access the MSRs,
    turbostat should clear all the counters added with --add.
    Because MSR access permission checks are done after the cmdline is
    parsed, the decision has to be defered up until the transition into
    no-msr mode happen.

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

Signed-off-by: David Arcari <darcari@redhat.com>
2024-04-27 14:21:33 -04:00
David Arcari 857e3edb63 tools/power turbostat: add early exits for permission checks
JIRA: https://issues.redhat.com/browse/RHEL-34610

commit aed48c48fa65abdd584e14f7d0273711bc10d223
Author: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
Date:   Tue Jan 30 23:57:07 2024 +0100

    tools/power turbostat: add early exits for permission checks

    Checking early if the permissions are even needed gets rid of the
    warnings about some of them missing. Earlier we issued a warning in case
    of missing MSR and/or perf permissions, even when user never asked for
    counters that require those.

    Signed-off-by: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-04-27 14:21:32 -04:00
David Arcari 9d1266bf82 tools/power turbostat: detect and disable unavailable BICs at runtime
JIRA: https://issues.redhat.com/browse/RHEL-34610

commit 5088741ec805cd249e27c7176ed09bdab164960e
Author: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
Date:   Mon Jan 15 19:04:21 2024 +0100

    tools/power turbostat: detect and disable unavailable BICs at runtime

    To allow unprivileged user to run turbostat seamlessly.

    Signed-off-by: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-04-27 14:21:32 -04:00
David Arcari 57c52bde2b tools/power turbostat: Add reading aperf and mperf via perf API
JIRA: https://issues.redhat.com/browse/RHEL-34610

commit e48934c9f1048ed4640b60321baf1986d1a470e1
Author: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
Date:   Thu Jan 11 16:42:22 2024 +0100

    tools/power turbostat: Add reading aperf and mperf via perf API

    By using the perf API we spend less time in between the reads of the
    counters, resulting in more accurate calculations of the dependent
    metrics.

    Using perf API is also usually faster overall, although cache miss, if
    we get one, is more costly when using perf vs MSR driver.

    We would fallback to the msr reads if the sysfs isn't there or when in
    --no-perf mode.

    Signed-off-by: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-04-27 14:21:32 -04:00
David Arcari 0c214b6a33 tools/power turbostat: Add --no-perf option
JIRA: https://issues.redhat.com/browse/RHEL-34610

commit a0e86c90b83c118985260e36490583b5a38d4359
Author: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
Date:   Thu Jan 11 15:58:02 2024 +0100

    tools/power turbostat: Add --no-perf option

    Add the --no-perf option to allow users to run turbostat without
    accessing perf.

    Signed-off-by: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>
    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-04-27 14:21:32 -04:00
David Arcari 6054495ee5 tools/power turbostat: Add --no-msr option
JIRA: https://issues.redhat.com/browse/RHEL-34610

commit 3e4048466c396cff52c6d435156dbcd0571e4381
Author: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
Date:   Thu Jan 11 15:48:09 2024 +0100

    tools/power turbostat: Add --no-msr option

    Add --no-msr option to allow users to run turbostat without
    accessing MSRs via the MSR driver.

    Signed-off-by: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>
    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-04-27 14:21:32 -04:00
David Arcari 53bf90fe3f tools/power turbostat: enhance -D (debug counter dump) output
JIRA: https://issues.redhat.com/browse/RHEL-34610

commit 2d2ccd57338779469777d4319152151272994182
Author: Len Brown <len.brown@intel.com>
Date:   Mon Feb 5 15:56:25 2024 -0600

    tools/power turbostat: enhance -D (debug counter dump) output

    Eliminate redundant debug output for core and package scope counters.

    Include name and path for all "ADDED" counters.

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

Signed-off-by: David Arcari <darcari@redhat.com>
2024-04-27 14:21:32 -04:00
David Arcari 9f6aa44904 tools/power turbostat: Fix warning upon failed /dev/cpu_dma_latency read
JIRA: https://issues.redhat.com/browse/RHEL-34610

commit b6fe938317eed58e8c687bd5965a956e15fb5828
Author: Len Brown <len.brown@intel.com>
Date:   Fri Jan 19 12:25:42 2024 -0600

    tools/power turbostat: Fix warning upon failed /dev/cpu_dma_latency read

    Previously a failed read of /dev/cpu_dma_latency erroneously complained
    turbostat: capget(CAP_SYS_ADMIN) failed, try "# setcap cap_sys_admin=ep ./turbostat

    This went unnoticed because this file is typically visible to root,
    and turbostat was typically run as root.

    Going forward, when a non-root user can run turbostat...
    Complain about failed read access to this file only if --debug is used.

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

Signed-off-by: David Arcari <darcari@redhat.com>
2024-04-27 14:21:32 -04:00
David Arcari 365dde1132 tools/power turbostat: Read base_hz and bclk from CPUID.16H if available
JIRA: https://issues.redhat.com/browse/RHEL-34610

commit 538d505fde20393bce1e6fb95cec82b56cdd22ef
Author: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
Date:   Mon Jan 22 15:22:35 2024 +0100

    tools/power turbostat: Read base_hz and bclk from CPUID.16H if available

    If MSRs cannot be read, values can be obtained from cpuid.

    Signed-off-by: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-04-27 14:21:32 -04:00
David Arcari 9a534fdb6b tools/power turbostat: Print ucode revision only if valid
JIRA: https://issues.redhat.com/browse/RHEL-34610

commit fb5ceca046efc84f69fcf9779a013f8a0e63bbff
Author: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
Date:   Fri Jan 12 13:48:14 2024 +0100

    tools/power turbostat: Print ucode revision only if valid

    If the MSR read were to fail, turbostat would print "microcode 0x0"

    Signed-off-by: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
    Reviewed-by: Len Brown <len.brown@intel.com>
    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-04-27 14:21:32 -04:00
David Arcari 7f2576526c tools/power turbostat: Expand probe_intel_uncore_frequency()
JIRA: https://issues.redhat.com/browse/RHEL-34610
JIRA: https://issues.redhat.com/browse/RHEL-29239

commit bb6181fa6bc942aac3f7f2fa8e3831952a2ef118
Author: Len Brown <len.brown@intel.com>
Date:   Wed Dec 20 13:11:05 2023 -0500

    tools/power turbostat: Expand probe_intel_uncore_frequency()

    Print current frequency along with the current (and initial) limits

    Probe and print uncore config also for machines using the new cluster API

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

Signed-off-by: David Arcari <darcari@redhat.com>
2024-04-27 14:21:11 -04:00
David Arcari 8a0ac186a6 tools/power turbostat: Do not print negative LPI residency
JIRA: https://issues.redhat.com/browse/RHEL-34610

commit 227ed18f456a68bbb69807294a9089208663a6d3
Author: Chen Yu <yu.c.chen@intel.com>
Date:   Sun Oct 22 13:52:21 2023 +0800

    tools/power turbostat: Do not print negative LPI residency

    turbostat prints the abnormal SYS%LPI across suspend-to-idle:
    SYS%LPI = 114479815993277.50

    This is reproduced by:
    Run a freeze cycle, e.g. "sleepgraph -m freeze -rtcwake 15".
    Then do a reboot. After boot up, launch the suspend-idle-idle
    and check the SYS%LPI field.

    The slp_so residence counter is in LPIT table, and BIOS does not
    clears this register across reset. The PMC expects the OS to calculate
    the LPI residency based on the delta. However, there is an firmware
    issue that the LPIT gets cleared to 0 during the second suspend
    to idle after the reboot, which brings negative delta value.

    [lenb: updated to print "neg" upon this BIOS failure]

    Reported-by: Todd Brandt <todd.e.brandt@intel.com>
    Signed-off-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>
2024-04-27 14:14:42 -04:00
David Arcari 1e1ae7b1b8 tools/power turbostat: Fix Bzy_MHz documentation typo
JIRA: https://issues.redhat.com/browse/RHEL-34610

commit 0b13410b52c4636aacb6964a4253a797c0fa0d16
Author: Peng Liu <liupeng17@lenovo.com>
Date:   Sat Oct 7 13:46:22 2023 +0800

    tools/power turbostat: Fix Bzy_MHz documentation typo

    The code calculates Bzy_MHz by multiplying TSC_delta * APERF_delta/MPERF_delta
    The man page erroneously showed that TSC_delta was divided.

    Signed-off-by: Peng Liu <liupeng17@lenovo.com>
    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-04-27 14:14:42 -04:00
David Arcari 0f18708ec3 tools/power turbostat: Increase the limit for fd opened
JIRA: https://issues.redhat.com/browse/RHEL-34610

commit 3ac1d14d0583a2de75d49a5234d767e2590384dd
Author: Wyes Karny <wyes.karny@amd.com>
Date:   Tue Oct 3 05:07:51 2023 +0000

    tools/power turbostat: Increase the limit for fd opened

    When running turbostat, a system with 512 cpus reaches the limit for
    maximum number of file descriptors that can be opened. To solve this
    problem, the limit is raised to 2^15, which is a large enough number.

    Below data is collected from AMD server systems while running turbostat:

    |-----------+-------------------------------|
    | # of cpus | # of opened fds for turbostat |
    |-----------+-------------------------------|
    | 128       | 260                           |
    |-----------+-------------------------------|
    | 192       | 388                           |
    |-----------+-------------------------------|
    | 512       | 1028                          |
    |-----------+-------------------------------|

    So, the new max limit would be sufficient up to 2^14 cpus (but this
    also depends on how many counters are enabled).

    Reviewed-by: Doug Smythies <dsmythies@telus.net>
    Tested-by: Doug Smythies <dsmythies@telus.net>
    Signed-off-by: Wyes Karny <wyes.karny@amd.com>
    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-04-27 14:14:42 -04:00
David Arcari 5303e567a0 tools/power turbostat: Fix added raw MSR output
JIRA: https://issues.redhat.com/browse/RHEL-34610

commit e5f4e68eed85fa8495d78cd966eecc2b27bb9e53
Author: Doug Smythies <dsmythies@telus.net>
Date:   Mon Apr 3 14:11:38 2023 -0700

    tools/power turbostat: Fix added raw MSR output

    When using --Summary mode, added MSRs in raw mode always
    print zeros. Print the actual register contents.

    Example, with patch:

    note the added column:
    --add msr0x64f,u32,package,raw,REASON

    Where:

    0x64F is MSR_CORE_PERF_LIMIT_REASONS

    Busy%   Bzy_MHz PkgTmp  PkgWatt CorWatt     REASON
    0.00    4800    35      1.42    0.76    0x00000000
    0.00    4801    34      1.42    0.76    0x00000000
    80.08   4531    66      108.17  107.52  0x08000000
    98.69   4530    66      133.21  132.54  0x08000000
    99.28   4505    66      128.26  127.60  0x0c000400
    99.65   4486    68      124.91  124.25  0x0c000400
    99.63   4483    68      124.90  124.25  0x0c000400
    79.34   4481    41      99.80   99.13   0x0c000000
    0.00    4801    41      1.40    0.73    0x0c000000

    Where, for the test processor (i5-10600K):

    PKG Limit #1: 125.000 Watts, 8.000000 sec
    MSR bit 26 = log; bit 10 = status

    PKG Limit #2: 136.000 Watts, 0.002441 sec
    MSR bit 27 = log; bit 11 = status

    Example, without patch:

    Busy%   Bzy_MHz PkgTmp  PkgWatt CorWatt     REASON
    0.01    4800    35      1.43    0.77    0x00000000
    0.00    4801    35      1.39    0.73    0x00000000
    83.49   4531    66      112.71  112.06  0x00000000
    98.69   4530    68      133.35  132.69  0x00000000
    99.31   4500    67      127.96  127.30  0x00000000
    99.63   4483    69      124.91  124.25  0x00000000
    99.61   4481    69      124.90  124.25  0x00000000
    99.61   4481    71      124.92  124.25  0x00000000
    59.35   4479    42      75.03   74.37   0x00000000
    0.00    4800    42      1.39    0.73    0x00000000
    0.00    4801    42      1.42    0.76    0x00000000

    c000000

    [lenb: simplified patch to apply only to package scope]

    Signed-off-by: Doug Smythies <dsmythies@telus.net>
    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-04-27 14:14:42 -04:00
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