CascadeLake-N only supports SST-BF and needs some of the perf-profile
commands, and the base-freq commands.
Add help functions, and create an empty command structures (the functions
will be implemented later in this patchset). Call these functions
when running on CascadeLake-N.
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Three CascadeLake-N models (6252N, 6230N, and 5218N) have SST-PBF support.
Return an error if the CascadeLake processor is not one of these specific
models.
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Make the process_command take any help command and command list. This
will make it easier to help commands and a command list for CascadeLake-N.
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
The current code structure has similar but separate command functions for
the enable and disable operations. This can be improved by adding an int
argument to the command function structure, and interpreting 1 as enable
and 0 as disable. This change results in the removal of the disable
command functions.
Add int argument to the command function structure.
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
The turbo-freq feature is dependent on the core-power feature. If the
core-power feature is disabled while the turbo-freq feature is enabled,
this will break the turbo-freq feature. This is a firmware limitation,
where they can't return error under this scenario.
So when trying to disable core-power, make sure that the turbo-freq
feature is not enabled. If it enabled, return error if user is trying to
disable the core-power feature.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Introduce --auto|-a option to turbo-freq enable feature, so that it
does in one step for users who are OK by setting all passed target cores
as high priority and set in CLOS 0 and remaining in CLOS 3. In this way,
users don't have to take multiple steps to enable turbo-freq feature. For
users who want more fine grain control, they can always use core-power
feature to set custom CLOS configuration and assignment.
While here also print the error to output when clos configuration fails.
For example
intel-speed-select -c 0-4 turbo-freq enable --auto
The above command will enable turbo-freq and core-power feature. Also
mark CPU 0 to CPU 4 as high priority.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Introduce --auto|-a option to base-freq enable feature, so that it
does in one step for users who are OK by setting all cores with higher
base frequency to be set in CLOS 0 and remaining in CLOS 3. This option
also sets corresponding clos.min to CLOS 0 and CLOS3. In this way, users
don't have to take multiple steps to enable base-freq feature. For users
who want more fine grain control, they can always use core-power feature
to set custom CLOS configuration and assignment.
Also adjust cpufreq/scaling_min_freq for higher and lower priority cores.
For example user can use:
intel-speed-select base-freq enable --auto
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Fix warning for:
isst-config.c: In function ‘set_cpu_online_offline’:
isst-config.c:221:3: warning: ignoring return value of ‘write’,
declared with attribute warn_unused_result [-Wunused-result]
write(fd, "1\n", 2);
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
* Fix compilation error of ASUS WMI driver when CONFIG_ACPI_BATTERY=n.
* Fix I²C multi-instantiate driver to work with several USB PD devices.
* Fix boot issue on Siemens SIMATIC IPC277E when PMC critical clock is
being disabled.
* Plenty of fixes to Intel Speed-Select Technology tools.
The following is an automated git shortlog grouped by driver:
asus-wmi:
- Make it depend on ACPI battery API
i2c-multi-instantiate:
- Derive the device name from parent
pmc_atom:
- Add Siemens SIMATIC IPC277E to critclk_systems DMI table
tools/power/x86/intel-speed-select:
- Fix perf-profile command output
- Extend core-power command set
- Fix some debug prints
- Format get-assoc information
- Allow online/offline based on tdp
- Fix high priority core mask over count
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEqaflIX74DDDzMJJtb7wzTHR8rCgFAl2JyzMACgkQb7wzTHR8
rChj1A//Uv4uFc5pWwYrvafvzho4uQ4TK0TDEvrDFEqxCcI7n2JGCWvXAuV8Lny4
oJ7enVjqDDMWkmN4KcONR8BWhZii23TzB+CDr1enCKYQv5J//di9jezVHtANw5oC
duKq2sPd7wkigpQmDk17sft5U2MPKOK9EgE/qMztNOSTm3XGcGSbD80Cr/o6P1w3
3TAZy/lED5jqjwvKmkDq/6fB3GdCG/b6LK56jhay5lew9Xi+WK9bTO3rzPo9nlvx
HKT3FuRhH3Dbx4EY4QO5ee1RVnwPG5swCjFw2ZPvpJoTsAxEMgbC2yaesRElLJvk
odIZrGDh2LqP8GCvtg6CQACsnRHzrze3H8PK75sCkFLkVMmw5Tp0knDMEakDQ39T
0lZWsHyN6x75Bmt15GIUCfYvDoBvvBar0UHwNwCQk4KS+IvH4F+CWC5gbCgHwvQZ
6bw1OSkdpP/wjf99ad2HJ9yFKP19qeSPIMwDEyZUgyLZBJoU12kEOB66Yyrpskve
djbsZe+hfBH8NFLMlgaBINFS4fISbUsYV+bOxPw2hSdbVdgajoOTPCaJOhfGEQap
b//gWBrDoX8LyibDW/b2zRhUvp2X944Z+Ve+btC2+XSHNt7/oy8q3Kh33dLIlEic
eMAyMKn3GhkxvT20AyxRoJf3Fy4W2KKPHu/QZ00VB/aKHz/6vc8=
=Cd14
-----END PGP SIGNATURE-----
Merge tag 'platform-drivers-x86-v5.4-2' of git://git.infradead.org/linux-platform-drivers-x86
Pull x86 platform-drivers fixes from Andy Shevchenko:
- Fix compilation error of ASUS WMI driver when CONFIG_ACPI_BATTERY=n
- Fix I²C multi-instantiate driver to work with several USB PD devices
- Fix boot issue on Siemens SIMATIC IPC277E when PMC critical clock is
being disabled
- Plenty of fixes to Intel Speed-Select Technology tools
* tag 'platform-drivers-x86-v5.4-2' of git://git.infradead.org/linux-platform-drivers-x86:
platform/x86: i2c-multi-instantiate: Derive the device name from parent
platform/x86: pmc_atom: Add Siemens SIMATIC IPC277E to critclk_systems DMI table
tools/power/x86/intel-speed-select: Fix perf-profile command output
tools/power/x86/intel-speed-select: Extend core-power command set
tools/power/x86/intel-speed-select: Fix some debug prints
tools/power/x86/intel-speed-select: Format get-assoc information
tools/power/x86/intel-speed-select: Allow online/offline based on tdp
tools/power/x86/intel-speed-select: Fix high priority core mask over count
platform/x86: asus-wmi: Make it depend on ACPI battery API
commit "c016ae8f9fa04d361efc8629de49ad3af12b5262
"tools/power/x86/intel-speed-select: Output success/failed for command
output" introduced a regression in perf-profile outputs. With this
the result field is changed to string interpreting every non zero
value as errors. But these commands display on zero (>0) result.
For example before this commit the display was:
package-1
die-0
cpu-14
get-config-levels:4
Here the get-config-levels is interpreted as error and displayed
as error with the above commit:
package-1
die-0
cpu-14
get-config-levels:failed(error 4)
Fix this issue by not using isst_display_result() to display such results,
but define a new function which formats this data and prints.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Add additional command to get the clos enable and priority type. The
current info option is actually dumping per clos QOS config, so name
the command appropriately to get-config.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Fix wrong debug print for cpu, which is displayed as CLOS. Also
avoid printing clos id, when user is specify clos as parameter.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Format the get-assoc command output consistant with other commands.
For example:
Intel(R) Speed Select Technology
Executing on CPU model:142[0x8e]
package-0
die-0
cpu-0
get-assoc
clos:0
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Using enable core mask, do online offline CPUs. There is a new option
--online|-o for set-config-level.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
If the CPU package has the less logical CPU than topo_max_cpus, but un-present
CPU's punit_cpu_core will be initiated to 0 and they will be count to core 0
Like below, there are only 10 high priority cores (20 logical CPUs) in the CPU
package, but it count to 27 logic CPUs.
./intel-speed-select base-freq info -l 0 | grep mask
high-priority-cpu-mask:7f000179,f000179f
With the fix patch:
./intel-speed-select base-freq info -l 0
high-priority-cpu-mask:00000179,f000179f
Signed-off-by: Youquan Song <youquan.song@intel.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
* ASUS WMI driver got couple of worth to mention updates, i.e. support of
FAN is fixed for recent products and the charge threshold support has been
added.
* Two uknown key events for Dell laptops are being ignored now to avoid spam
user with harmless messages.
* HP ZBook 17 G5 and ASUS Zenbook UX430UNR have got accelerometer support.
* Intel CherryTrail platforms got a regression with wake up. Now it's fixed.
* Intel PMC driver got fixed in order to work nicely in Xen environment.
* Intel Speed Select driver provides bucket vs core count relationship.
Besides that the tools has been updated for better output.
* The PrivacyGuard is enabled on Lenovo ThinkPad laptops.
* Three tablets, i.e. Trekstor Primebook C11B 2-in-1, Irbis TW90 and
Chuwi Surbook Mini, have got touchscreen support.
The following is an automated git shortlog grouped by driver:
acer-wmi:
- Switch to acpi_dev_get_first_match_dev()
asus-nb-wmi:
- Support ALS on the Zenbook UX430UNR
asus-wmi:
- Refactor charge threshold to use the battery hooking API
- Rename CHARGE_THRESHOLD to RSOC
- Reorder ASUS_WMI_CHARGE_THRESHOLD
- Fix condition in charge_threshold_store()
- Remove unnecessary blank lines
- Drop indentation level by inverting conditionals
- Use clamp_val() instead of open coded variant
- Replace sscanf() with kstrtoint()
- Refactor charge_threshold_store()
- Add support for charge threshold
- fix CPU fan control on recent products
- add a helper for device presence
- cleanup AGFN fan handling
- Use kmemdup rather than duplicating its implementation
compal-laptop:
- Initialize "value" in ec_read_u8()
dell-wmi:
- Use existing defined KBD_LED_* magic values
- Ignore keyboard backlight change KBD_LED_AUTO_TOKEN
- Ignore keyboard backlight change KBD_LED_ON_TOKEN
hp_accel:
- Add support for HP ZBook 17 G5
i2c-multi-instantiate:
- Use struct_size() helper
intel_bxtwc_tmu:
- Remove dev_err() usage after platform_get_irq()
intel_int0002_vgpio:
- Use device_init_wakeup
- Fix wakeups not working on Cherry Trail
- Remove dev_err() usage after platform_get_irq()
intel_pmc_core:
- Do not ioremap RAM
intel_pmc_core_pltdrv:
- Module removal warning fix
intel_pmc_ipc:
- Remove dev_err() usage after platform_get_irq()
ISST:
- Allow additional TRL MSRs
- Use dev_get_drvdata
MAINTAINERS:
- Switch PDx86 subsystem status to Odd Fixes
pcengines-apuv2:
- wire up simswitch gpio as led
- add mpcie reset gpio export
platform/mellanox:
- mlxreg-hotplug: Remove dev_err() usage after platform_get_irq()
pmc_atom:
- Add Siemens SIMATIC IPC227E to critclk_systems DMI table
thinkpad_acpi:
- Add ThinkPad PrivacyGuard
- Use kmemdup rather than duplicating its implementation
tools/power/x86/intel-speed-select:
- Display core count for bucket
- Fix memory leak
- Output success/failed for command output
- Output human readable CPU list
- Change turbo ratio output to maximum turbo frequency
- Switch output to MHz
- Simplify output for turbo-freq and base-freq
- Fix cpu-count output
- Fix help option typo
- Fix package typo
- Fix a read overflow in isst_set_tdp_level_msr()
touchscreen_dmi:
- Add info for the Trekstor Primebook C11B 2-in-1
- Add info for the Irbis TW90 tablet
- Add info for the Chuwi Surbook Mini tablet
wmi:
- Remove acpi_has_method() call
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEqaflIX74DDDzMJJtb7wzTHR8rCgFAl17y/4ACgkQb7wzTHR8
rCjMyA//Zgv//XuQUqAPon/UAxu2FhDC40VBicm4AuNUtkqbN2cE04ZosyVQWLr9
ZNVgTu5CU2HR5HIuA6Xn3+FIadLYe/qpXhOvCTKQa/SrbvZLKxeoEBzoqIOgxvpN
90xkoKIp6GB+N2zjeKAhyuiJ2wce2RKok3mWOEdaEBqsrTT3LFToCpF+crpbKv81
UECMUet7ymdq+ryNYjCW4O2YmQYUpI3aGvv0MRJ9uQJrUfdN0Pa/lsXqmd5/agyi
6J5RP0LDSUJat8lOzxzWWF7pHa7dbVuDVzKlfKt6yIOmK4YqiwE9OLoVEDmpyCNx
22/pIDsJcPcdeUaAzwNEO7ao+UKQ2jXmh0IhkO9DkFziJfLz73Ucv47ZJzdPYhEo
bQtr9FlcttJ5Xxw/j6tQTSGasmSZCXElfiVJObujxRu47bSqlH/846PRK3kcWrga
AgFlIpvqO5J+ZkEZTohQltRPEfnJC4GbpjHnNOFvk0bowBc7KWk3EzDsJ6GvyIIX
z9pKpQ6OmjmiVZmA+aIxMbxYvgYobNGjCeUH20duqgLaMtzqZ3MgU4NXnuSbzX5t
8AL9irGE4JclJ7gkOh7SGIKdibXTjeUC9bPV0efqHn2P8sEigsYtDfaUA67XMDZ/
xYvKxC4XR/msJMkz4hRk9WyTEFAXbLW/teLE9nLBEBTguWemDuk=
=HItn
-----END PGP SIGNATURE-----
Merge tag 'platform-drivers-x86-v5.4-1' of git://git.infradead.org/linux-platform-drivers-x86
Pull x86 platform-drivers updates from Andy Shevchenko:
- ASUS WMI driver got a couple of updates, i.e. support of FAN is fixed
for recent products and the charge threshold support has been added
- Two uknown key events for Dell laptops are being ignored now to avoid
spamming users with harmless messages
- HP ZBook 17 G5 and ASUS Zenbook UX430UNR got accelerometer support.
- Intel CherryTrail platforms had a regression with wake up. Now it's
fixed
- Intel PMC driver got fixed in order to work nicely in Xen
environment
- Intel Speed Select driver provides bucket vs core count relationship.
Besides that the tools has been updated for better output
- The PrivacyGuard is enabled on Lenovo ThinkPad laptops
- Three tablets - Trekstor Primebook C11B 2-in-1, Irbis TW90 and Chuwi
Surbook Mini - got touchscreen support
* tag 'platform-drivers-x86-v5.4-1' of git://git.infradead.org/linux-platform-drivers-x86: (53 commits)
MAINTAINERS: Switch PDx86 subsystem status to Odd Fixes
platform/x86: asus-wmi: Refactor charge threshold to use the battery hooking API
platform/x86: asus-wmi: Rename CHARGE_THRESHOLD to RSOC
platform/x86: asus-wmi: Reorder ASUS_WMI_CHARGE_THRESHOLD
tools/power/x86/intel-speed-select: Display core count for bucket
platform/x86: ISST: Allow additional TRL MSRs
tools/power/x86/intel-speed-select: Fix memory leak
tools/power/x86/intel-speed-select: Output success/failed for command output
tools/power/x86/intel-speed-select: Output human readable CPU list
tools/power/x86/intel-speed-select: Change turbo ratio output to maximum turbo frequency
tools/power/x86/intel-speed-select: Switch output to MHz
tools/power/x86/intel-speed-select: Simplify output for turbo-freq and base-freq
tools/power/x86/intel-speed-select: Fix cpu-count output
tools/power/x86/intel-speed-select: Fix help option typo
tools/power/x86/intel-speed-select: Fix package typo
tools/power/x86/intel-speed-select: Fix a read overflow in isst_set_tdp_level_msr()
platform/x86: intel_int0002_vgpio: Use device_init_wakeup
platform/x86: intel_int0002_vgpio: Fix wakeups not working on Cherry Trail
platform/x86: compal-laptop: Initialize "value" in ec_read_u8()
platform/x86: touchscreen_dmi: Add info for the Trekstor Primebook C11B 2-in-1
...
Read the bucket and core count relationship via MSR and display
when displaying turbo ratio limits.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
cpumasks are allocated by calling the alloc_cpu_mask() function and are
never free'd. They should be free'd after the commands have run.
Fix the memory leaks by calling free_cpu_set().
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: David Arcari <darcari@redhat.com>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
The intel-speed-select tool currently only outputs a hexidecimal CPU mask,
which requires translation for use with kernel parameters such as
isolcpus.
Along with the CPU mask, output a human readable CPU list.
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: David Arcari <darcari@redhat.com>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
The intel-speed-select tool currently outputs the turbo ratio for every
bucket. Make the output more user-friendly by changing the output to the
maximum turbo frequency.
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: David Arcari <darcari@redhat.com>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
These features are introduced on new processors that will never operate
in the KHz range.
Save some zeros and switch the output to MHz.
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: David Arcari <darcari@redhat.com>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
The current output of 'intel-speed-select -c 53 perf-profile info -l 0'
shows
speed-select-turbo-freq-support:1
speed-select-base-freq-support:1
speed-select-base-freq-enabled:0
speed-select-turbo-freq-enabled:0
Simplify the output to single lines displaying status of disabled,
enabled, and unsupported.
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: David Arcari <darcari@redhat.com>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
I have a system with 28 threads/socket but intel-speed-select reports
a cpu-count of 29.
Fix an off-by-one error in the cpu_count() function.
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: David Arcari <darcari@redhat.com>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
The isst_send_msr_command() function will read 8 bytes but we are
passing an address to an int (4 bytes) so it results in a read overflow.
Fixes: 3fb4f7cd47 ("tools/power/x86: A tool to validate Intel Speed Select commands")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Conflicts:
tools/power/x86/turbostat/turbostat.c
Recent turbostat changes conflicted with a pending rename of x86 model names in tip:x86/cpu,
sort it out.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Commit 9392bd98bb ("tools/power turbostat: Add support for AMD
Fam 17h (Zen) RAPL") and the commit 3316f99a9f ("tools/power
turbostat: Also read package power on AMD F17h (Zen)") add AMD Fam 17h
RAPL support.
Hygon Family 18h(Dhyana) support RAPL in bit 14 of CPUID 0x80000007 EDX,
and has MSRs RAPL_PWR_UNIT/CORE_ENERGY_STAT/PKG_ENERGY_STAT. So add Hygon
Dhyana Family 18h support for RAPL.
Already tested on Hygon multi-node systems and it shows correct per-core
energy usage and the total package power.
Signed-off-by: Pu Wen <puwen@hygon.cn>
Reviewed-by: Calvin Walton <calvin.walton@kepstin.ca>
Signed-off-by: Len Brown <len.brown@intel.com>
Commit 9392bd98bb ("tools/power turbostat: Add support for AMD
Fam 17h (Zen) RAPL") add a function get_tdp_amd(), the parameter is CPU
family. But the rapl_probe_amd() function use wrong model parameter.
Fix the wrong caller parameter of get_tdp_amd() to use family.
Cc: <stable@vger.kernel.org> # v5.1+
Signed-off-by: Pu Wen <puwen@hygon.cn>
Reviewed-by: Calvin Walton <calvin.walton@kepstin.ca>
Signed-off-by: Len Brown <len.brown@intel.com>
In some case C1% will be wrong value, when platform doesn't have MSR for
C1 residency.
For example:
Core CPU CPU%c1
- - 100.00
0 0 100.00
0 2 100.00
1 1 100.00
1 3 100.00
But adding Busy% will fix this
Core CPU Busy% CPU%c1
- - 99.77 0.23
0 0 99.77 0.23
0 2 99.77 0.23
1 1 99.77 0.23
1 3 99.77 0.23
This issue can be reproduced on most of the recent systems including
Broadwell, Skylake and later.
This is because if we don't select Busy% or Avg_MHz or Bzy_MHz then
mperf value will not be read from MSR, so it will be 0. But this
is required for C1% calculation when MSR for C1 residency is not present.
Same is true for C3, C6 and C7 column selection.
So add another define DO_BIC_READ(), which doesn't depend on user
column selection and use for mperf, C3, C6 and C7 related counters.
So when there is no platform support for C1 residency counters,
we still read these counters, if the CPU has support and user selected
display of CPU%c1.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Turbostat works by taking a snapshot of counters, sleeping, taking another
snapshot, calculating deltas, and printing out the table.
The sleep time is controlled via -i option or by user sending a signal or a
character to stdin. In the latter case, turbostat always adds 1 ms
sleep before it reads the counters, in order to avoid larger imprecisions
in the results in prints.
While the 1 ms delay may be a good idea for a "dumb" user, it is a
problem for an "aware" user. I do thousands and thousands of measurements
over a short period of time (like 2ms), and turbostat unconditionally adds
a 1ms to my interval, so I cannot get what I really need.
This patch removes the unconditional 1ms sleep. This is an expert user
tool, after all, and non-experts will unlikely ever use it in the non-fixed
interval mode anyway, so I think it is OK to remove the 1ms delay.
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Commit '47936f944e78 tools/power turbostat: fix printing on input' make
a valid fix, but it completely disabled piped stdin support, which is
a valuable use-case. Indeed, if stdin is a pipe, turbostat won't read
anything from it, so it becomes impossible to get turbostat output at
user-defined moments, instead of the regular intervals.
There is no reason why this should works for terminals, but not for
pipes. This patch improves the situation. Instead of ignoring pipes, we
read data from them but gracefully handle the EOF case.
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
This enables turbostat utility on Ice Lake NNPI SoC.
Link: https://lkml.org/lkml/2019/6/5/1034
Signed-off-by: Rajneesh Bhardwaj <rajneesh.bhardwaj@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Perhaps if this more descriptive name had been used,
then we wouldn't have had the HSW ULT vs HSW CORE bug,
fixed by the previous commit.
Signed-off-by: Len Brown <len.brown@intel.com>
turbostat: cpu0: msr offset 0x630 read failed: Input/output error
because Haswell Core does not have C8-C10.
Output C8-C10 only on Haswell ULT.
Fixes: f5a4c76ad7 ("tools/power turbostat: consolidate duplicate model numbers")
Reported-by: Prarit Bhargava <prarit@redhat.com>
Suggested-by: Kosuke Tatsukawa <tatsu@ab.jp.nec.com>
Signed-off-by: Len Brown <len.brown@intel.com>
turbostat could be terminated by general protection fault on some latest
hardwares which (for example) support 9 levels of C-states and show 18
"tADDED" lines. That bloats the total output and finally causes buffer
overrun. So let's extend the buffer to avoid this.
Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Currently the error return path does not close the file fp and leaks
a file descriptor. Fix this by closing the file.
Fixes: 5ea7647b33 ("tools/power turbostat: Warn on bad ACPI LPIT data")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Turbostat currently normalizes TSC and other values by dividing by an
interval. This interval is the delta between the start of one global
(all counters on all CPUs) sampling and the start of another. However,
this introduces a lot of jitter into the data.
In order to reduce jitter, the interval calculation should be based on
timestamps taken per thread and close to the start of the thread's
sampling.
Define a per thread time value to hold the delta between samples taken
on the thread.
Use the timestamp taken at the beginning of sampling to calculate the
delta.
Move the thread's beginning timestamp to after the CPU migration to
avoid jitter due to the migration.
Use the global time delta for the average time delta.
Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Len Brown <len.brown@intel.com>
The -w argument in x86_energy_perf_policy currently triggers an
unconditional segfault.
This is because the argument string reads: "+a:c:dD:E:e:f:m:M:rt:u:vw" and
yet the argument handler expects an argument.
When parse_optarg_string is called with a null argument, we then proceed to
crash in strncmp, not horribly friendly.
The man page describes -w as taking an argument, the long form
(--hwp-window) is correctly marked as taking a required argument, and the
code expects it.
As such, this patch simply marks the short form (-w) as requiring an
argument.
Signed-off-by: Zephaniah E. Loss-Cutler-Hull <zephaniah@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Compiling without optimisations is silly, especially since some
warnings depend on the optimiser. Use -O2.
Fortify adds warnings for unchecked I/O (among other things), which
seems to be a good idea for user-space code. Enable that too.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Len Brown <len.brown@intel.com>
x86_energy_perf_policy first uses __get_cpuid() to check the maximum
CPUID level and exits if it is too low. It then assumes that later
calls will succeed (which I think is architecturally guaranteed). It
also assumes that CPUID works at all (which is not guaranteed on
x86_32).
If optimisations are enabled, gcc warns about potentially
uninitialized variables. Fix this by adding an exit-on-error after
every call to __get_cpuid() instead of just checking the maximum
level.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Len Brown <len.brown@intel.com>
Currently big microservers have _XEON_D while small microservers have
_X, Make it uniformly: _D.
for i in `git grep -l "\(INTEL_FAM6_\|VULNWL_INTEL\|INTEL_CPU_FAM6\).*_\(X\|XEON_D\)"`
do
sed -i -e 's/\(\(INTEL_FAM6_\|VULNWL_INTEL\|INTEL_CPU_FAM6\).*ATOM.*\)_X/\1_D/g' \
-e 's/\(\(INTEL_FAM6_\|VULNWL_INTEL\|INTEL_CPU_FAM6\).*\)_XEON_D/\1_D/g' ${i}
done
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Cc: x86@kernel.org
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Borislav Petkov <bp@alien8.de>
Link: https://lkml.kernel.org/r/20190827195122.677152989@infradead.org
Currently big core clients with extra graphics on have:
- _G
- _GT3E
Make it uniformly: _G
for i in `git grep -l "\(INTEL_FAM6_\|VULNWL_INTEL\|INTEL_CPU_FAM6\).*_GT3E"`
do
sed -i -e 's/\(\(INTEL_FAM6_\|VULNWL_INTEL\|INTEL_CPU_FAM6\).*\)_GT3E/\1_G/g' ${i}
done
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Cc: x86@kernel.org
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Borislav Petkov <bp@alien8.de>
Link: https://lkml.kernel.org/r/20190827195122.622802314@infradead.org