Commit Graph

1213 Commits

Author SHA1 Message Date
David Woodhouse
b85e2dab33 PM: tools: Fix sleepgraph syntax error
The sleepgraph tool currently fails:

  File "/usr/bin/sleepgraph", line 4155
    or re.match('psci: CPU(?P<cpu>[0-9]*) killed.*', msg)):
                                                         ^
SyntaxError: unmatched ')'

Fixes: 34ea427e01 ("PM: tools: sleepgraph: Recognize "CPU killed" messages")
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2023-11-20 17:59:58 +01:00
Linus Torvalds
9ea991a50d turbostat-2023.11.07
-----BEGIN PGP SIGNATURE-----
 
 iQJIBAABCgAyFiEE67dNfPFP+XUaA73mB9BFOha3NhcFAmVO9MoUHGxlbi5icm93
 bkBpbnRlbC5jb20ACgkQB9BFOha3NhcJqhAAryDKEnmhbz0Xu746fL6cuTqrsJXr
 7QyswqsJnzqWHWvFsxzBXvXe9iCH73dlfT2TGtPbKuevskvJVAhNGrULIX+k9ddP
 rVRgKvCyJuajMzTbKEjJDUm1a142WFSUNPBxvH6LSdmqmMhPt76cK19Z38kIreMt
 CM+c0NJwzEGED7SvsCR4SV2dSzrbru40ni6knsYjbaaeUr5pRE3W4qxbSwVdKBW4
 lnnmU6R0xZkZ0IYA90xiXso4YZ81dBY4vV4pUpVewqgT1uQOLA4pfabIW8fYDPnW
 gkUtAVFWaky2L7zwvLsMkg5f3gkTKUCCKkDEbBuWj84YwqAOHC2pV23aJ2iBkP2C
 SyBnHiI9u0oYg+uDtM8SPxoTDiDhSNUq/mfVa/VZwwItSb1IOiTlhCrRzU4z4+IO
 R/+eyJYsK//EiIs9EjVANafzGbnvrBvfZAkXVrHExfSyiN/6wDrpo2E4lFeELxwW
 CUf4X1dtv/RdFFjju5cu/Q/DntENqxife9QHRTsn1lJsPZ+Pp/D9qZ4shA+o1P6a
 bnXDph4DjCC7i2QYo55NcO6LbfpVJ03IPg3CZjScaW1PCN4ELkE9AJju7HkHEZCB
 icOvpKF4vOjeGJRQI0BDXr1w0re1ZSg2ylDCappq0ud/zSOkYIK6q1V2Uh4CWGv+
 XX43X38SiMdyfuc=
 =J72l
 -----END PGP SIGNATURE-----

Merge tag 'turbostat-2023.11.07' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux

Pull turbostat updates from Len Brown:

 - 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

[ This came in during the merge window, but sorting out the signed tag
  took a while, so thus the late merge   - Linus ]

* tag 'turbostat-2023.11.07' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux: (86 commits)
  tools/power turbostat: version 2023.11.07
  tools/power/turbostat: bugfix "--show IPC"
  tools/power/turbostat: Add initial support for LunarLake
  tools/power/turbostat: Add initial support for ArrowLake
  tools/power/turbostat: Add initial support for GrandRidge
  tools/power/turbostat: Add initial support for SierraForest
  tools/power/turbostat: Add initial support for GraniteRapids
  tools/power/turbostat: Add MSR_CORE_C1_RES support for spr_features
  tools/power/turbostat: Move process to root cgroup
  tools/power/turbostat: Handle cgroup v2 cpu limitation
  tools/power/turbostat: Abstrct function for parsing cpu string
  tools/power/turbostat: Handle offlined CPUs in cpu_subset
  tools/power/turbostat: Obey allowed CPUs for system summary
  tools/power/turbostat: Obey allowed CPUs for primary thread/core detection
  tools/power/turbostat: Abstract several functions
  tools/power/turbostat: Obey allowed CPUs during startup
  tools/power/turbostat: Obey allowed CPUs when accessing CPU counters
  tools/power/turbostat: Introduce cpu_allowed_set
  tools/power/turbostat: Remove PC7/PC9 support on ADL/RPL
  tools/power/turbostat: Enable MSR_CORE_C1_RES on recent Intel client platforms
  ...
2023-11-18 09:09:17 -08:00
Len Brown
b8337e6a78 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>
2023-11-07 23:28:30 -05:00
Len Brown
f2c1dba311 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>
2023-11-07 23:26:42 -05:00
Rafael J. Wysocki
36cbb924d6 Merge branch 'pm-tools'
Merge cpupower utility update for 6.7-rc1:

 - Fix a reference to a removed document in the cpupower utility
   documentation (Vegard Nossum).

* pm-tools:
  cpupower: fix reference to nonexistent document
2023-11-07 20:46:13 +01:00
Rafael J. Wysocki
a563c99f22 linux-cpupower-6.7-rc1
This cpupower update for Linux 6.7-rc1 consists of a single fix to
 documentation to fix reference to a removed document.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEPZKym/RZuOCGeA/kCwJExA0NQxwFAmVBZZcACgkQCwJExA0N
 QxxB9w/+KfLlAOCThW9LZauqVsVJHzzMuDi6ctuvnUsy39Xf/VH22SzakhYoujfT
 vuQ43cLqIT/p9HkjbQnC0uJTx3nIIs/qWRWyklMn9ETAp+TP14ewTFRYAiPL/XRh
 GylTbCzh2QmU0oiR81Cq4bMRGkzywGHKi7g+E5LQ7ACz1McreWHIXonPokLEGO7n
 61Z1M9Q43333IZSAE+erop5CVJTOsFTf3Ox2RLroNg9MNFX1OiUuBrpSsG2O44BX
 59A0vQxIRuDqDgBDZapb0lpjj/E4pdyuKbBSZVDDKXbe9vWdhomibwMISiM9vjNm
 z8zy2lUA+qUE2UDSZFVFVDKk8hPwgSvcZfKhFUuuc3K+vXixNfxhFg7TVdH5RwkV
 pNgcXMuQjqPXz4k59MWS0E68aWPsvfsA3Xt/GD3yr4aSDskrzIiyc6F0u67mW1qG
 T1sQdzg2AHKXb7g774T2OW6ugeoEZ5LftDDZxTZx0+UIGk7JysXb9ksNJTqItnCI
 j4MSOK25EbHR/pk0cJAlCfn6kGYYOMzuTiOf+xEz4FvYHeduEAvUbT5irBMGkETI
 W4hwsv/fUPOhVMc4uYEZCIf6vcdLPDs9REvB55VGQm4O3CNM+ETBeRwnDHD8QaWg
 qPM8+vnrUjiE33YVPF0F/QhkJxSo+SZP79igwzpBva5ttkUuOpg=
 =p8rZ
 -----END PGP SIGNATURE-----

Merge tag 'linux-cpupower-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux

Merge cpupower utility update for 6.7-rc1 from Shuah Khan:

"This cpupower update for Linux 6.7-rc1 consists of a single fix to
 documentation to fix reference to a removed document."

* tag 'linux-cpupower-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux:
  cpupower: fix reference to nonexistent document
2023-11-03 15:30:10 +01:00
Linus Torvalds
7dc0e9c7dd linux_kselftest-next-6.7-rc1
This kselftest update for Linux 6.7-rc1 consists of:
 
 -- kbuild kselftest-merge target fixes
 -- fixes to several tests
 -- resctrl test fixes and enhancements
 -- ksft_perror() helper and reporting improvements
 -- printf attribute to kselftest prints to improve reporting
 -- documentation and clang build warning fixes
 
 Bulk of the patches are for resctrl fixes and enhancements.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEPZKym/RZuOCGeA/kCwJExA0NQxwFAmVCoHMACgkQCwJExA0N
 QxwzrA//ehiiLdV2lyghzPpDTVY8jKlB1xIpg3s0r0M3m/j6nAdnOgOe2gkapT7T
 gFGL0r7xL9crqFdymwDANLSvNWOeghqB1oIok9Ruw5Rl3FcLnkh920bE6tPsddJg
 9+/KqtZvL0Sr43l9OSgX2Uzqyw60wRQwpO0431hmgnKjblk8Rh4GZ7fUCLLNf4Ia
 yOq1s2/cdmEwRc96lDaBWZaOTusejwh/xy8tgAjozHipLsmsexbyyHVWJWkVhMOD
 ZklCtrq4lckRz+Vky6akvjoL6Mjl//7pg323e2fUcDCQxQvqwnCo2VqqyOVBnN2A
 6XHQ6yXwh0xzCKRFgAiFhWlsKOz3wEIDrdp4dmhDkg4lw4gGJcwNke1UyX5zXYKM
 1a6R1vbQS9qQOsWf34AYKZBHruFNtUt0FJYgI43SuH+fGc0D5cU91Rz+s9QIPCwj
 8tcr5RWin8BOziDz05lxSKWRHD+3oc5qmsmGYBJhilwtvY2wNbRZNDZjiO28kiIy
 3kUWXeCtHmZE1KHK1H5v6bMC8SqUU7ukvV5WebqGpxzJ2eFPbeXcek9/AWSWOFni
 7thUg6MG3e4c/zRk8JYbmqXS/GeTkdmc3+VMXApLhTB8uSOWsnVMfJS9Zc2A1tGg
 n6NRBJFQO8t9Wm1l9XvlnC9HA/8lO/3uih+SzKn/u8KvoN96HPM=
 =JZb+
 -----END PGP SIGNATURE-----

Merge tag 'linux_kselftest-next-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest

Pull kselftest updates from Shuah Khan:

 - kbuild kselftest-merge target fixes

 - fixes to several tests

 - resctrl test fixes and enhancements

 - ksft_perror() helper and reporting improvements

 - printf attribute to kselftest prints to improve reporting

 - documentation and clang build warning fixes

The bulk of the patches are for resctrl fixes and enhancements.

* tag 'linux_kselftest-next-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: (51 commits)
  selftests/resctrl: Fix MBM test failure when MBA unavailable
  selftests/clone3: Report descriptive test names
  selftests:modify the incorrect print format
  selftests/efivarfs: create-read: fix a resource leak
  selftests/ftrace: Add riscv support for kprobe arg tests
  selftests/ftrace: add loongarch support for kprobe args char tests
  selftests/amd-pstate: Added option to provide perf binary path
  selftests/amd-pstate: Fix broken paths to run workloads in amd-pstate-ut
  selftests/resctrl: Move run_benchmark() to a more fitting file
  selftests/resctrl: Fix schemata write error check
  selftests/resctrl: Reduce failures due to outliers in MBA/MBM tests
  selftests/resctrl: Fix feature checks
  selftests/resctrl: Refactor feature check to use resource and feature name
  selftests/resctrl: Move _GNU_SOURCE define into Makefile
  selftests/resctrl: Remove duplicate feature check from CMT test
  selftests/resctrl: Extend signal handler coverage to unmount on receiving signal
  selftests/resctrl: Fix uninitialized .sa_flags
  selftests/resctrl: Cleanup benchmark argument parsing
  selftests/resctrl: Remove ben_count variable
  selftests/resctrl: Make benchmark command const and build it with pointers
  ...
2023-11-01 17:08:10 -10:00
Linus Torvalds
59fff63cc2 platform-drivers-x86 for v6.7-1
Highlights:
  - asus-wmi:		Support for screenpad and solve brightness key
 			press duplication
  - int3472:		Eliminate the last use of deprecated GPIO functions
  - mlxbf-pmc:		New HW support
  - msi-ec:		Support new EC configurations
  - thinkpad_acpi:	Support reading aux MAC address during passthrough
  - wmi: 		Fixes & improvements
  - x86-android-tablets:	Detection fix and avoid use of GPIO private APIs
  - Debug & metrics interface improvements
  - Miscellaneous cleanups / fixes / improvements
 
 The following is an automated shortlog grouped by driver:
 
 acer-wmi:
  -  Remove void function return
 
 amd/hsmp:
  -  add support for metrics tbl
  -  create plat specific struct
  -  Fix iomem handling
  -  improve the error log
 
 amd/pmc:
  -  Add dump_custom_stb module parameter
  -  Add PMFW command id to support S2D force flush
  -  Handle overflow cases where the num_samples range is higher
  -  Use flex array when calling amd_pmc_stb_debugfs_open_v2()
 
 asus-wireless:
  -  Replace open coded acpi_match_acpi_device()
 
 asus-wmi:
  -  add support for ASUS screenpad
  -  Do not report brightness up/down keys when also reported by acpi_video
 
 gpiolib: acpi:
  -  Add a ignore interrupt quirk for Peaq C1010
  -  Check if a GPIO is listed in ignore_interrupt earlier
 
 hp-bioscfg:
  -  Annotate struct bios_args with __counted_by
 
 inspur-platform-profile:
  -  Add platform profile support
 
 int3472:
  -  Add new skl_int3472_fill_gpiod_lookup() helper
  -  Add new skl_int3472_gpiod_get_from_temp_lookup() helper
  -  Stop using gpiod_toggle_active_low()
  -  Switch to devm_get_gpiod()
 
 intel: bytcrc_pwrsrc:
  -  Convert to platform remove callback returning void
 
 intel/ifs:
  -  Add new CPU support
  -  Add new error code
  -  ARRAY BIST for Sierra Forest
  -  Gen2 scan image loading
  -  Gen2 Scan test support
  -  Metadata validation for start_chunk
  -  Refactor image loading code
  -  Store IFS generation number
  -  Validate image size
 
 intel_speed_select_if:
  -  Remove hardcoded map size
  -  Use devm_ioremap_resource
 
 intel/tpmi:
  -  Add debugfs support for read/write blocked
  -  Add defines to get version information
 
 intel-uncore-freq:
  -  Ignore minor version change
 
 ISST:
  -  Allow level 0 to be not present
  -  Ignore minor version change
  -  Use fuse enabled mask instead of allowed levels
 
 mellanox:
  -  Fix misspelling error in routine name
  -  Rename some init()/exit() functions for consistent naming
 
 mlxbf-bootctl:
  -  Convert to platform remove callback returning void
 
 mlxbf-pmc:
  -  Add support for BlueField-3
 
 mlxbf-tmfifo:
  -  Convert to platform remove callback returning void
 
 mlx-Convert to platform remove callback returning void:
  - mlx-Convert to platform remove callback returning void
 
 mlxreg-hotplug:
  -  Convert to platform remove callback returning void
 
 mlxreg-io:
  -  Convert to platform remove callback returning void
 
 mlxreg-lc:
  -  Convert to platform remove callback returning void
 
 msi-ec:
  -  Add more EC configs
  -  rename fn_super_swap
 
 nvsw-sn2201:
  -  Convert to platform remove callback returning void
 
 sel3350-Convert to platform remove callback returning void:
  - sel3350-Convert to platform remove callback returning void
 
 siemens: simatic-ipc-batt-apollolake:
  -  Convert to platform remove callback returning void
 
 siemens: simatic-ipc-batt:
  -  Convert to platform remove callback returning void
 
 siemens: simatic-ipc-batt-elkhartlake:
  -  Convert to platform remove callback returning void
 
 siemens: simatic-ipc-batt-f7188x:
  -  Convert to platform remove callback returning void
 
 siemens: simatic-ipc-batt:
  -  Simplify simatic_ipc_batt_remove()
 
 surface: acpi-notify:
  -  Convert to platform remove callback returning void
 
 surface: aggregator:
  -  Annotate struct ssam_event with __counted_by
 
 surface: aggregator-cdev:
  -  Convert to platform remove callback returning void
 
 surface: aggregator-registry:
  -  Convert to platform remove callback returning void
 
 surface: dtx:
  -  Convert to platform remove callback returning void
 
 surface: gpe:
  -  Convert to platform remove callback returning void
 
 surface: hotplug:
  -  Convert to platform remove callback returning void
 
 surface: surface3-wmi:
  -  Convert to platform remove callback returning void
 
 think-lmi:
  -  Add bulk save feature
  -  Replace kstrdup() + strreplace() with kstrdup_and_replace()
  -  Use strreplace() to replace a character by nul
 
 thinkpad_acpi:
  -  Add battery quirk for Thinkpad X120e
  -  replace deprecated strncpy with memcpy
  -  sysfs interface to auxmac
 
 tools/power/x86/intel-speed-select:
  -  Display error for core-power support
  -  Increase max CPUs in one request
  -  No TRL for non compute domains
  -  Sanitize integer arguments
  -  turbo-mode enable disable swapped
  -  Update help for TRL
  -  Use cgroup isolate for CPU 0
  -  v1.18 release
 
 wmi:
  -  Decouple probe deferring from wmi_block_list
  -  Decouple WMI device removal from wmi_block_list
  -  Fix opening of char device
  -  Fix probe failure when failing to register WMI devices
  -  Fix refcounting of WMI devices in legacy functions
 
 x86-android-tablets:
  -  Add a comment about x86_android_tablet_get_gpiod()
  -  Create a platform_device from module_init()
  -  Drop "linux,power-supply-name" from lenovo_yt3_bq25892_0_props[]
  -  Fix Lenovo Yoga Tablet 2 830F/L vs 1050F/L detection
  -  Remove invalid_aei_gpiochip from Peaq C1010
  -  Remove invalid_aei_gpiochip support
  -  Stop using gpiolib private APIs
  -  Use platform-device as gpio-keys parent
 
 xo15-ebook:
  -  Replace open coded acpi_match_acpi_device()
 
 Merges:
  -  Merge branch 'pdx86/platform-drivers-x86-int3472' into review-ilpo
  -  Merge branch 'pdx86/platform-drivers-x86-mellanox-init' into review-ilpo
  -  Merge remote-tracking branch 'intel-speed-select/intel-sst' into review-ilpo
  -  Merge remote-tracking branch 'pdx86/platform-drivers-x86-android-tablets' into review-hans
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQSCSUwRdwTNL2MhaBlZrE9hU+XOMQUCZT+lBwAKCRBZrE9hU+XO
 Mck0AQCFU7dYLCF4d1CXtHf1eZhSXLpYdhcO+C08JGGoM+MqSgD+Jyb9KJHk4pxE
 FvKG51I9neyAne9lvNrLodHRzxCYgAo=
 =duM8
 -----END PGP SIGNATURE-----

Merge tag 'platform-drivers-x86-v6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86

Pull x86 platform driver updates from Ilpo Järvinen:

 - asus-wmi: Support for screenpad and solve brightness key press
   duplication

 - int3472: Eliminate the last use of deprecated GPIO functions

 - mlxbf-pmc: New HW support

 - msi-ec: Support new EC configurations

 - thinkpad_acpi: Support reading aux MAC address during passthrough

 - wmi: Fixes & improvements

 - x86-android-tablets: Detection fix and avoid use of GPIO private APIs

 - Debug & metrics interface improvements

 - Miscellaneous cleanups / fixes / improvements

* tag 'platform-drivers-x86-v6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: (80 commits)
  platform/x86: inspur-platform-profile: Add platform profile support
  platform/x86: thinkpad_acpi: Add battery quirk for Thinkpad X120e
  platform/x86: wmi: Decouple WMI device removal from wmi_block_list
  platform/x86: wmi: Fix opening of char device
  platform/x86: wmi: Fix probe failure when failing to register WMI devices
  platform/x86: wmi: Fix refcounting of WMI devices in legacy functions
  platform/x86: wmi: Decouple probe deferring from wmi_block_list
  platform/x86/amd/hsmp: Fix iomem handling
  platform/x86: asus-wmi: Do not report brightness up/down keys when also reported by acpi_video
  platform/x86: thinkpad_acpi: replace deprecated strncpy with memcpy
  tools/power/x86/intel-speed-select: v1.18 release
  tools/power/x86/intel-speed-select: Use cgroup isolate for CPU 0
  tools/power/x86/intel-speed-select: Increase max CPUs in one request
  tools/power/x86/intel-speed-select: Display error for core-power support
  tools/power/x86/intel-speed-select: No TRL for non compute domains
  tools/power/x86/intel-speed-select: turbo-mode enable disable swapped
  tools/power/x86/intel-speed-select: Update help for TRL
  tools/power/x86/intel-speed-select: Sanitize integer arguments
  platform/x86: acer-wmi: Remove void function return
  platform/x86/amd/pmc: Add dump_custom_stb module parameter
  ...
2023-10-31 17:53:00 -10:00
Vegard Nossum
6feb1a9641 cpupower: fix reference to nonexistent document
This file was renamed from .txt to .rst and left a dangling reference.
Fix it.

Fixes: 151f4e2bdc ("docs: power: convert docs to ReST and rename to *.rst")
Cc: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Jacob Pan <jacob.jun.pan@linux.intel.com>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Len Brown <len.brown@intel.com>
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2023-10-25 10:14:35 -06:00
Sumeet Pawnikar
956dbd3de4 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>
2023-10-24 13:38:09 +08:00
Sumeet Pawnikar
7b57e7b683 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>
2023-10-24 13:38:09 +08:00
Zhang Rui
5a6efcb910 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>
2023-10-24 13:38:09 +08:00
Zhang Rui
d33605f367 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>
2023-10-24 13:38:09 +08:00
Zhang Rui
5feab4a6b8 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>
2023-10-24 13:38:09 +08:00
Zhang Rui
0e3f10e6aa 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>
2023-10-24 13:38:09 +08:00
Srinivas Pandruvada
37f68a2940 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>
2023-10-24 13:38:09 +08:00
Zhang Rui
f638858da0 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>
2023-10-24 13:38:09 +08:00
Zhang Rui
8c3dd2c9e5 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>
2023-10-24 13:37:46 +08:00
Zhang Rui
c25ef0e5d9 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>
2023-10-20 14:21:27 +08:00
Zhang Rui
0fe3752901 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>
2023-10-20 14:20:07 +08:00
Zhang Rui
ccf8a05280 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>
2023-10-20 10:27:09 +08:00
Zhang Rui
74318add13 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>
2023-10-20 10:27:09 +08:00
Zhang Rui
7bb3fe27ad 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>
2023-10-20 10:27:09 +08:00
Zhang Rui
4ede6d1ce7 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>
2023-10-20 10:27:09 +08:00
Zhang Rui
71cfd1da9f 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>
2023-10-20 10:24:00 +08:00
Srinivas Pandruvada
a590ed6226 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>
2023-10-17 14:54:44 -07:00
Srinivas Pandruvada
3bc0f20a8c 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>
2023-10-17 11:55:37 -07:00
Srinivas Pandruvada
bc5370cca0 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>
2023-10-17 11:55:37 -07:00
Srinivas Pandruvada
da4c1b9e8f 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>
2023-10-17 11:55:37 -07:00
Srinivas Pandruvada
2fe8d2d791 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>
2023-10-17 11:55:37 -07:00
Srinivas Pandruvada
7b00d1018c 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>
2023-10-17 11:55:37 -07:00
Srinivas Pandruvada
3076db34b5 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>
2023-10-17 11:55:37 -07:00
Srinivas Pandruvada
61f3d868b3 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>
2023-10-17 11:55:37 -07:00
Swapnil Sapkal
27aabb2c43 selftests/amd-pstate: Fix broken paths to run workloads in amd-pstate-ut
In selftests/amd-pstate, tbench and gitsource microbenchmarks are
used to compare the performance with different governors. In current
implementation the relative path to run `amd_pstate_tracer.py` is broken.
Fix this by using absolute paths.

Signed-off-by: Swapnil Sapkal <swapnil.sapkal@amd.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2023-10-16 13:06:50 -06:00
Zhang Rui
6b74a30b76 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>
2023-09-27 22:14:21 +08:00
Zhang Rui
05ad96ff0f 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>
2023-09-27 22:14:21 +08:00
Zhang Rui
7ee39d8d59 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>
2023-09-27 22:14:21 +08:00
Zhang Rui
5612b2c89b 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>
2023-09-27 22:14:20 +08:00
Zhang Rui
ce7a32c2a4 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>
2023-09-27 22:14:20 +08:00
Zhang Rui
db735f8ba7 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>
2023-09-27 22:14:20 +08:00
Zhang Rui
e7d7b82de1 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>
2023-09-27 22:14:20 +08:00
Zhang Rui
2538d1673d 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>
2023-09-27 22:14:20 +08:00
Zhang Rui
6cb13609a0 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>
2023-09-27 22:14:20 +08:00
Zhang Rui
622c8f2355 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>
2023-09-27 22:14:20 +08:00
Zhang Rui
11cd9a09f3 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>
2023-09-27 22:14:20 +08:00
Zhang Rui
045acf6064 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>
2023-09-27 22:14:20 +08:00
Zhang Rui
32e8c6169a 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>
2023-09-27 22:14:20 +08:00
Zhang Rui
d085b3b0f1 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>
2023-09-27 22:14:20 +08:00
Zhang Rui
7d0ebe6f7e 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>
2023-09-27 22:14:20 +08:00
Zhang Rui
ed43247b15 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>
2023-09-27 22:14:20 +08:00