Skip to content

Add support for configure and control of Hardware Trace Macro(HTM)

Athira Rajeev linuxppc-dev 3 versions – Applied

Status from this message: Applied to powerpc/next.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest9 patches 1 replyApplied
  2. v29 patches 1 replySuperseded
  3. v19 patches 2 repliesSuperseded

Changes in v3 from the cover letter

- Added Tested-by from Venkat.
- Addressed review comments from Maddy:
1. Disable the interface in kvm guest
2. Instead of using 1 and 0 to enable/disable HTM during some of the operations, use macro (ex: HTM_ENABLE, HTM_DISABLE for 1, 0
respectively
3. In code where htm return code gives negative, add a failure message

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/9powerpc/pseries/htmdump: Add htm_hcall_wrapper to integrate other htm operationsarch/powerpc/include/asm/plpar_wrappers.h arch/powerpc/platforms/pseries/htmdump.c+63 -180 replies
2/9powerpc/pseries/htmdump: Add htm configure support to htmdump modulearch/powerpc/platforms/pseries/htmdump.c+56 -00 replies
3/9powerpc/pseries/htmdump: Add htm start support to htmdump modulearch/powerpc/platforms/pseries/htmdump.c+50 -00 replies
4/9powerpc/pseries/htmdump: Add htm status support to htmdump modulearch/powerpc/platforms/pseries/htmdump.c+57 -00 replies
5/9powerpc/pseries/htmdump: Add htm info support to htmdump modulearch/powerpc/platforms/pseries/htmdump.c+51 -00 replies
6/9powerpc/pseries/htmdump: Add htm setup support to htmdump modulearch/powerpc/platforms/pseries/htmdump.c+38 -00 replies
7/9powerpc/pseries/htmdump: Add htm flags support to htmdump modulearch/powerpc/include/asm/plpar_wrappers.h arch/powerpc/platforms/pseries/htmdump.c+50 -110 replies
8/9powerpc/pseries/htmdump: Add htm capabilities support to htmdump modulearch/powerpc/platforms/pseries/htmdump.c+40 -00 replies
9/9powerpc/pseries/htmdump: Add documentation for H_HTM debugfs interfaceDocumentation/arch/powerpc/htm.rst+104 -00 replies

Reviews trailers per patch

None of the 9 patches has a Reviewed-by or Acked-by.

PatchVenkat Rao Bagalkote
1/9T-b
2/9T-b
3/9T-b
4/9T-b
5/9T-b
6/9T-b
7/9T-b
8/9T-b
9/9T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH V3 0/9] Add support for configure and control of Hardware Trace Macro(HTM)

H_HTM (Hardware Trace Macro) hypervisor call is an HCALL to export data from Hardware Trace Macro (HTM) function. The debugfs interface to export the HTM function data in a partition currently supports only dumping of HTM data in an lpar. Patchset add support for configuration and control of HTM function via debugfs interface.

With the patchset, after loading htmdump module,
below files are present:

ls /sys/kernel/debug/powerpc/htmdump/
coreindexonchip htmcaps htmconfigure htmflags htminfo htmsetup htmstart htmstatus htmtype nodalchipindex nodeindex trace

- nodeindex, nodalchipindex, coreindexonchip specifies which partition to configure the HTM for.
- htmtype: specifies the type of HTM. Supported target is hardwareTarget.
- trace: is to read the HTM data.
- htmconfigure: Configure/Deconfigure the HTM. Writing 1 to the file will configure the trace, writing 0 to the file will do deconfigure.
- htmstart: start/Stop the HTM. Writing 1 to the file will start the tracing, writing 0 to the file will stop the tracing.
- htmstatus: get the status of HTM. This is needed to understand the HTM state after each operation.
- htmsetup: set the HTM buffer size. Size of HTM buffer is in power of 2.
- htminfo: provides the system processor configuration details. This is needed to understand the appropriate values for nodeindex, nodalchipindex, coreindexonchip.
- htmcaps : provides the HTM capabilities like minimum/maximum buffer size, what kind of tracing the HTM supports etc.
- htmflags : allows to pass flags to hcall. Currently supports controlling the wrapping of HTM buffer.

Example usage:
To collect HTM traces for a partition represented by nodeindex as zero, nodalchipindex as 1 and coreindexonchip as 12.

  # cd /sys/kernel/debug/powerpc/htmdump/
  # echo 2 > htmtype
  # echo 0 > nodeindex
  # echo 1 > nodalchipindex
  # echo 12 > coreindexonchip
  # echo 1 > htmflags     # to set noWrap for HTM buffers
  # echo 1 > htmconfigure # Configure the HTM
  # echo 1 > htmstart     # Start the HTM
  # echo 0 > htmstart     # Stop the HTM
  # echo 0 > htmconfigure # Deconfigure the HTM
  # cat htmstatus         # Dump the status of HTM entries as data

Changelog:
V2 -> V3:
- Added Tested-by from Venkat.
- Addressed review comments from Maddy:
1. Disable the interface in kvm guest
2. Instead of using 1 and 0 to enable/disable HTM during some of the operations, use macro (ex: HTM_ENABLE, HTM_DISABLE for 1, 0
respectively
3. In code where htm return code gives negative, add a failure message

V1 -> V2:
V2: Venkat reported that patch 7 failed to apply on powerpc-next. Fixed that in V2.

Athira Rajeev (9):
powerpc/pseries/htmdump: Add htm_hcall_wrapper to integrate other htm
operations
powerpc/pseries/htmdump: Add htm configure support to htmdump module powerpc/pseries/htmdump: Add htm start support to htmdump module powerpc/pseries/htmdump: Add htm status support to htmdump module powerpc/pseries/htmdump: Add htm info support to htmdump module powerpc/pseries/htmdump: Add htm setup support to htmdump module powerpc/pseries/htmdump: Add htm flags support to htmdump module powerpc/pseries/htmdump: Add htm capabilities support to htmdump
module
powerpc/pseries/htmdump: Add documentation for H_HTM debugfs interface

 Documentation/arch/powerpc/htm.rst        | 104 ++++++
 arch/powerpc/include/asm/plpar_wrappers.h |  20 +-
 arch/powerpc/platforms/pseries/htmdump.c  | 394 +++++++++++++++++++++-
 3 files changed, 499 insertions(+), 19 deletions(-)
 create mode 100644 Documentation/arch/powerpc/htm.rst
Signature · 1 line
2.43.0