summaryrefslogtreecommitdiff
path: root/tools/power/x86/intel-speed-select/isst-config.c
AgeCommit message (Collapse)AuthorFilesLines
2021-06-18tools/power/x86/intel-speed-select: v1.10 releaseSrinivas Pandruvada1-1/+1
This release adds following change: - Fix reporting of memory frequency Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-18tools/power/x86/intel-speed-select: Fix uncore memory frequency displaySrinivas Pandruvada1-0/+16
The uncore memory frequency value from the mailbox command CONFIG_TDP_GET_MEM_FREQ needs to be scaled based on the platform for display. There is no single constant multiplier. This change introduces CPU model specific memory frequency multiplier. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-04-07tools/power/x86/intel-speed-select: v1.9 releaseSrinivas Pandruvada1-1/+1
This release adds following changes: - Support increased number of CPUs - Return error when mailbox commmand fails to enable core-power - Option to online all CPUs - Removes build date and time print Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-04-07tools/power/x86/intel-speed-select: Drop __DATE__ and __TIME__ macrosAntonio Terceiro1-1/+0
These macros introduce nondeterminism in builds, and break reproducible builds. Signed-off-by: Antonio Terceiro <antonio.terceiro@linaro.org> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-04-07tools/power/x86/intel-speed-select: Add options to force onlineSrinivas Pandruvada1-2/+21
It is possible that users manually offlined CPUs via sysfs interface and then started this utility. In this case we will not be able to get package and die id of the those CPUs. So add an option to force online if required for some commands. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-04-07tools/power/x86/intel-speed-select: Process mailbox read error for core-powerSrinivas Pandruvada1-0/+4
Some older kernels don't support reading core-power status. In that case mailbox command fails. So, display core-power status as "unknown" instead of supported. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-02-08tools/power/x86/intel-speed-select: Update version to 1.8Srinivas Pandruvada1-1/+1
Update version for changes released with v5.12 kernel release. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2021-02-08tools/power/x86/intel-speed-select: Add new command to get/set TRLSrinivas Pandruvada1-1/+52
Add a new command to get and set TRL (Turbo Ratio Limits). This will help users to get/set TRL, when the direct MSR access is removed. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2021-02-08tools/power/x86/intel-speed-select: Add new command turbo-modeSrinivas Pandruvada1-1/+61
Add a new command "turbo-mode", which allows to enable/disable turbo mode globally. This uses base-frequency as the max frequency when turbo-mode is disabled. This allows soft disable turbo mode without depending on kernel or BIOS. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2021-01-04tools/power/x86/intel-speed-select: Set higher of cpuinfo_max_freq or ↵Srinivas Pandruvada1-0/+11
base_frequency In some case when BIOS disabled turbo, cpufreq cpuinfo_max_freq can be lower than base_frequency at higher config level. So, in that case set scaling_min_freq to base_frequency. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Link: https://lore.kernel.org/r/20201221071859.2783957-3-srinivas.pandruvada@linux.intel.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-01-04tools/power/x86/intel-speed-select: Set scaling_max_freq to base_frequencySrinivas Pandruvada1-0/+21
When BIOS disables turbo, The scaling_max_freq in cpufreq sysfs will be limited to config level 0 base frequency. But when user selects a higher config levels, this will result in higher base frequency. But since scaling_max_freq is still old base frequency, the performance will still be limited. So when the turbo is disabled and cpufreq base_frequency is higher than scaling_max_freq, update the scaling_max_freq to the base_frequency. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Link: https://lore.kernel.org/r/20201221071859.2783957-2-srinivas.pandruvada@linux.intel.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2020-12-08tools/power/x86/intel-speed-select: Update version for v5.11Srinivas Pandruvada1-1/+1
Update version for changes released with v5.11 kernel release. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Link: https://lore.kernel.org/platform-driver-x86/57d6648282491906e0e1f70fe3b9a44f72cec90d.camel@intel.com/ Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2020-12-08tools/power/x86/intel-speed-select: Account for missing sysfs for die_idSrinivas Pandruvada1-1/+5
Some older kernels will not have support to get CPU die_id from the sysfs. This requires several back ports. But the tool depends on getting die_id to match to correct CPU. Relax this restriction and use die_id as 0 when die_id is missing. This is not a problem as we don't have any multi-die processors with Intel SST support. This helps in running this tool on older kernels with just Intel SST drivers back ported. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Link: https://lore.kernel.org/platform-driver-x86/57d6648282491906e0e1f70fe3b9a44f72cec90d.camel@intel.com/ Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2020-10-07tools/power/x86/intel-speed-select: Update version for v5.10Srinivas Pandruvada1-1/+1
Update version for changes released with v5.10 kernel release. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2020-10-07tools/power/x86/intel-speed-select: Fix missing base-freq core IDsJonathan Doman1-9/+12
The reported base-freq high-priority-cpu-list was potentially omitting some cpus, due to incorrectly using a logical core count to constrain the size of a physical punit core ID mask. We may need to read both high and low PBF CORE_MASK values regardless of the logical core count. Signed-off-by: Jonathan Doman <jonathan.doman@intel.com> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2020-07-16tools/power/x86/intel-speed-select: Update version for v5.9Srinivas Pandruvada1-1/+1
Update version for changes released with v5.9 kernel release. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2020-07-16tools/power/x86/intel-speed-select: Add retries for mail box commandsSrinivas Pandruvada1-16/+36
Retry mail box command on failure. The default retry count is 3. This can be changed by "-r|--retry" options. This helps during early bring up of platforms. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2020-07-16tools/power/x86/intel-speed-select: Add option to delay mbox commandsSrinivas Pandruvada1-0/+15
Add option "p|--pause" to introduce delay between two mail box commands for test purpose. This delay can be specified in milliseconds. By default there is no delay between two mailbox commands. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2020-07-16tools/power/x86/intel-speed-select: Ignore -o option processing on errorSrinivas Pandruvada1-1/+5
When for some reason, CONFIG_TDP_GET_CORE_MASK mailbox command fails, then don't continue online/offline operation for perf-profile set-config-level with "-o" option. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2020-07-16tools/power/x86/intel-speed-select: Change path for caching topology infoSrinivas Pandruvada1-2/+4
We want to cache the topology info to a file, which is not preserved across boot cycle. The current storage in /tmp is getting preserved. So change the path from /tmp/isst_cpu_topology.dat to /var/run/isst_cpu_topology.dat. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2020-05-22tools/power/x86/intel-speed-select: Fix invalid core maskSrinivas Pandruvada1-1/+1
The core mask display is wrong in some cases. This is showing more cpus than the mask has. This is because mask is 64 bit but it used with BIT() macro to get the presence of CPU which doesn't support unsigned long long. Added a new macro for BIT_ULL and use that to get the presence of a CPU. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2020-05-22tools/power/x86/intel-speed-select: Increase CPU countSrinivas Pandruvada1-1/+1
Increase CPU count so that more than 64 is supported in one request. For example: sudo ./intel-speed-select -d --cpu 0-66 core-power assoc -clos 0 The above command stops at 63. With this change, it can support more CPU numbers from 0-255. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2020-05-11tools/power/x86/intel-speed-select: Update versionSrinivas Pandruvada1-1/+1
Update version to include 5.8 series enhancements. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2020-05-11tools/power/x86/intel-speed-select: Enable clos for turbo-freq enableSrinivas Pandruvada1-1/+1
turbo-freq enable, requires clos enable. So this is a two step process, when "-a" option is used. This is causing confusion to users. So enable clos by default for turbo-freq enable. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2020-05-11tools/power/x86/intel-speed-select: Fix CLX-N package information outputPrarit Bhargava1-0/+1
On CLX-N the perf-profile output is missing the package, die, and cpu output. On CLX-N the pkg_dev struct will never be evaluated by the core code so pkg_dev.processed is always 0 and the package, die, and cpu information is never output. Set the pkg_dev.processed flag to 1 for CLX-N processors. Signed-off-by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Cc: andriy.shevchenko@linux.intel.com Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Cc: platform-driver-x86@vger.kernel.org
2020-05-11tools/power/x86/intel-speed-select: Check support status before enableSrinivas Pandruvada1-0/+40
When turbo-freq or base-freq feature is not supported, the enable will fail. So first check support status and print error. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2020-03-20tools/power/x86/intel-speed-select: Fix a typo in error messageMasanari Iida1-1/+1
This patch fix a spelling typo in error message. Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20tools/power/x86/intel-speed-select: Update versionSrinivas Pandruvada1-1/+1
Fair number of changes including bug fixes done to change version. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20tools/power/x86/intel-speed-select: Print friendly warning for bad command lineSrinivas Pandruvada1-1/+4
When user specifies invalid option, display "Unknown Option: ignore", instead of "no match". Also display error for garbage on the command line. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20tools/power/x86/intel-speed-select: Fix avx options for turbo-freq featureSrinivas Pandruvada1-2/+2
Specifying "avx2" and "avx512" option for display filter doesn't work with short option "-r", only works with --try-type. Also compare full 6 characters for "avx512" string. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20tools/power/x86/intel-speed-select: Improve CLX commandsSrinivas Pandruvada1-10/+6
CLX doesn't have capability to change the feature in the hardware, but this acts as "--auto | -a" option. So even if user didn't specify the option, use this as --auto | -a to set cpufreq scaling frequency limits. Also remove perror with debug_printf as they don't bring any value. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20tools/power/x86/intel-speed-select: Show error for invalid CPUs in the optionsSrinivas Pandruvada1-2/+7
When --cpu or -c is used to specify target CPUs and non of them are valid, display error. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20tools/power/x86/intel-speed-select: Improve core-power result and error displaySrinivas Pandruvada1-35/+52
This change adds improved error display and handling for commands related to core-power feature. The changes include: - Replace perror with helpful error message - Use ordered priority for SKX based platform by default as the proportional priority is not supported - Don't show weight and epp in help and also give error when user tries to set them in SKX based platforms - Range check for epp and weights and display error Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20tools/power/x86/intel-speed-select: Kernel interface error handlingSrinivas Pandruvada1-6/+22
Treat a case when mailbox/mmio command can't be handled by the kernel drivers when the module is removed or send a command which no driver can handle. In this case ENOTTY result is returned, so print error. Also when the isst_if_mmio module is removed, we can't send CLOS message messages via Mailbox on non SKX based platforms. When this module is removed, isst_platform_info.mmio_supported is set to 0. So it can't be used as a condition to send via mailbox. Here replace check for Skylake based platform to send via mailbox, other platforms can't use mailbox in lieu of MMIO. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20tools/power/x86/intel-speed-select: Improve error display for turbo-freq featureSrinivas Pandruvada1-6/+9
This change adds improved error display and handling for commands related to turbo-freq feature. The changes include: - Replace perror/fprintf with helpful error message - Error for not specifying TDP level when required - Show error for invalid bucket number - Show message to enable core-power before enabling turbo-freq feature Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20tools/power/x86/intel-speed-select: Improve error display for base-freq featureSrinivas Pandruvada1-4/+21
This change adds improved error display and handling for commands related to base-freq feature. The changes include: - Replace perror/fprintf with helpful error message - Error for not specifying TDP level when required - For CLX show help which shows limitation Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20tools/power/x86/intel-speed-select: Improve output of perf-profile commandsSrinivas Pandruvada1-8/+12
Improve output of perf-profile commands: get-config-enabled get-lock-status Instead of showing 0/1, show meaningful strings. Also show error when command is failed. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20tools/power/x86/intel-speed-select: Enhance help for core-power assocSrinivas Pandruvada1-0/+4
Enhance help to specify CPU and clos by an example. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20tools/power/x86/intel-speed-select: Improve error display for perf-profile ↵Srinivas Pandruvada1-5/+16
feature This change adds improved error display and handling for commands related to perf-profile feature. The changes include: - When invalid TDP level is passed. display error and exit - Replace perror with helpful error message - Show error when TDP level can't be set - Print error when information can't be read for a level - Validate user options for invalid level - Display error for TDP lock status Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20tools/power/x86/intel-speed-select: Add an API for error/information printSrinivas Pandruvada1-0/+5
Add a common API which can be used to print all error and information messages. In this way a common format can be used. For json output an error index in suffixed to make unique error key. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20tools/power/x86/intel-speed-select: Enhance --info optionSrinivas Pandruvada1-0/+74
Add additional information, which will allow user to detect available features. This will allow users to check presence of features before continue to test. A sample output: $sudo ./intel-speed-select --info Intel(R) Speed Select Technology Executing on CPU model:85[0x55] Platform: API version : 1 Platform: Driver version : 1 Platform: mbox supported : 1 Platform: mmio supported : 0 Intel(R) SST-PP (feature perf-profile) is not supported Only performance level 0 (base level) is present TDP level change control is locked Intel(R) SST-TF (feature turbo-freq) is supported Intel(R) SST-BF (feature base-freq) is supported Intel(R) SST-CP (feature core-power) is supported Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20tools/power/x86/intel-speed-select: Enhance helpSrinivas Pandruvada1-5/+24
Enhance help message which adds some example. The changes include: - Print help when options are not recognized. - For CLX, display only options which are applicable. - Sort options in alphatical order. - Disply help() instead of error: "Feature name and|or command not specified" - Remove duplicate display of Intel(R) Speed Select Technology Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20tools/power/x86/intel-speed-select: Helpful warning for missing kernel interfaceSrinivas Pandruvada1-10/+24
When the device file "/dev/isst_interface" is not present, instead of failing on access, check at the start and print a helpful warning. Here CLX platform is an exception, which doesn't depend on the device file. So continue for CLX platform. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20tools/power/x86/intel-speed-select: Store topology informationSrinivas Pandruvada1-11/+132
Once the CPU is offline, the topology information (core-id, package-id, die-id) is not accessible via sysfs. So when user selects a config level more than base config 0 and offlined CPUs to match the config level, to return to base config he has to manually online CPUs before. Without this CPUs information mapping from Punit CPU numbering will lot work as it needs atlest package id for each CPU. To avoid this additional steps store the topology information in a file , which is created on the very first run after boot. Since system boots in base config and all CPUs are online, we can get information about every CPU. Once any of the APIs like get_physical_package_id(), get_physical_core_id() or get_physical_die_id() fails to read from sysfs, read from the stored mapping file. This mapping file is stored in /tmp file system. so on every boot it is recreated to make sure that any new CPUs are added to the system before boot are taken into account. But don't use the stored physical device id when trying to get information for CPU to send message in for_each_online_package_in_set(). Here use the real value from syfs and in case fails try the next CPU. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20tools/power/x86/intel-speed-select: Max CPU count calculation when CPU0 is ↵Srinivas Pandruvada1-2/+16
offline Currently /sys/devices/system/cpu/cpu0/topology/thread_siblings is used to get the max CPU count. But when CPU0 is offline, then this file will be absent. So add processing so that we can get count from any first CPU in the system. which is online. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20tools/power/x86/intel-speed-select: Special handling for CPU 0 online/offlineSrinivas Pandruvada1-1/+7
When "-o" option for force online/offline is used with command: perf-profile set-config-level If the config level calls for CPU 0 online/offline, then call fails as there is special kernel setup required for CPU 0 online/offline and the currently not setup for that. But when call is for online CPU 0, then don't fail. Just warn that this system is not setup for CPU 0 online/offline. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20tools/power/x86/intel-speed-select: Enhance core-power info commandSrinivas Pandruvada1-2/+7
In addition to CLOS enable status, also show the core-power feature status. This will help why clos enable status didn't give desired results as the core-power feature may be disabled or unsupported. The new display looks as follows: $intel-speed-select core-power info Intel(R) Speed Select Technology .. package-0 die-0 cpu-0 core-power support-status:supported enable-status:enabled clos-enable-status:1 priority-type:0 In the above display "support-status" and "enable-status", shows the status of the core-power feature and "clos-enable-status", shows the status of the clos. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20tools/power/x86/intel-speed-select: Make target CPU optional for core-power infoSrinivas Pandruvada1-9/+7
Currently "-c" is a mandatory option for "core-power info" command. Make this optional as this is a per package/die property. When not specified, it will print info for every package/die. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20tools/power/x86/intel-speed-select: Warn for invalid package idSrinivas Pandruvada1-0/+8
When CPU is offline, we can't get package id. So print error for this and don't use output. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20tools/power/x86/intel-speed-select: Fix last cpu numberSrinivas Pandruvada1-1/+0
Here topology_max_cpus is used for total CPU count, not the last CPU number. So remove "-1". Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>