diff mbox series

htm: Documentation update

Message ID 20180803014217.30979-1-mikey@neuling.org
State Accepted
Headers show
Series htm: Documentation update | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success master/apply_patch Successfully applied
snowpatch_ozlabs/build-multiarch success Test build-multiarch on branch master

Commit Message

Michael Neuling Aug. 3, 2018, 1:42 a.m. UTC
Signed-off-by: Michael Neuling <mikey@neuling.org>
---
 README.md | 45 +++++++++++++++++++++++++++++----------------
 1 file changed, 29 insertions(+), 16 deletions(-)

Comments

Alistair Popple Aug. 3, 2018, 5:29 a.m. UTC | #1
Thanks!

- Alistair

On Friday, 3 August 2018 11:42:17 AM AEST Michael Neuling wrote:
> Signed-off-by: Michael Neuling <mikey@neuling.org>
> ---
>  README.md | 45 +++++++++++++++++++++++++++++----------------
>  1 file changed, 29 insertions(+), 16 deletions(-)
> 
> diff --git a/README.md b/README.md
> index a698703709..878e6d3419 100644
> --- a/README.md
> +++ b/README.md
> @@ -329,26 +329,39 @@ $  sudo ./pdbg -p 0  getmem -ci 0x0003ffff40000000 4 |hexdump -C
>  00000004
>  ```
>  
> -### Hardware Trace Macro
> +### Hardware Trace Macro (HTM)
>  
> -Expoitation of HTM is limited to POWER9 NestHTM from the powerpc host.
> -POWER8 (core and nest).
> +Exploitation of HTM is limited to POWER8 Core from the powerpc host.
>  
> -pdbg provides a `htm` command with a variety of subcommands the most
> +#### Prerequisites
> +
> +Core HTM on POWER8 needs to run SMT1 and no power save, so you need to
> +run this first:
> +```
> +ppc64_cpu --smt=1
> +for i in /sys/devices/system/cpu/cpu*/cpuidle/state*/disable;do echo 1 > $i;done
> +```
> +Also, using HTM requires a kernel built with both `CONFIG_PPC_MEMTRACE=y`
> +(v4.14) and `CONFIG_SCOM_DEBUGFS=y`. debugfs should be mounted at
> +`/sys/kernel/debug`. Ubuntu 18.04 has this by default.
> +
> +#### How to run HTM
> +
> +pdbg provides a `htm` command with a variety of sub-commands. The most
>  useful command is `record` which will start the trace, wait for buffer
> -to fill (~1 sec), stop and then dump (~5 sec). eg.
> +to fill (~1 sec), stop and then dump the trace to a file (~5 sec). eg.
> +```
> +pdbg -l 0 htm core record
> +```
> +pdbg -l allows users to specify CPUs using the same addressing as
> +scheme as taskset -c. This can be useful for tracing workloads. eg.
>  ```
> -pdbg -p0 -c4 core htm record
> +taskset -c 0 myworkload
> +sleep 1
> +pdbg -l 0 htm core record
>  ```
> -There are also low level commands which can also be used:
> +There are also low level htm commands which can also be used:
>   - `start` will configure the hardware and start tracing in wrapping mode.
> - - `stop` will still stop the trace and deconfigure the hardware
> - - `dump` will dump the trace to a file
> + - `stop` will still stop the trace and de-configure the hardware.
> + - `dump` will dump the trace to a file.
>  
> -If you are running into a checkstop issue, `htm status` will print the
> -physical address of the buffer it is tracing into and the BMC can be
> -used to recover this memory after checkstop see `getmem`.
> -
> -Using HTM requires a kernel built with both `CONFIG_PPC_MEMTRACE=y`
> -(v4.14) and `CONFIG_SCOM_DEBUGFS=y`. debugfs should be mounted at
> -`/sys/kernel/debug`. Ubuntu 18.04 has this by default.
>
diff mbox series

Patch

diff --git a/README.md b/README.md
index a698703709..878e6d3419 100644
--- a/README.md
+++ b/README.md
@@ -329,26 +329,39 @@  $  sudo ./pdbg -p 0  getmem -ci 0x0003ffff40000000 4 |hexdump -C
 00000004
 ```
 
-### Hardware Trace Macro
+### Hardware Trace Macro (HTM)
 
-Expoitation of HTM is limited to POWER9 NestHTM from the powerpc host.
-POWER8 (core and nest).
+Exploitation of HTM is limited to POWER8 Core from the powerpc host.
 
-pdbg provides a `htm` command with a variety of subcommands the most
+#### Prerequisites
+
+Core HTM on POWER8 needs to run SMT1 and no power save, so you need to
+run this first:
+```
+ppc64_cpu --smt=1
+for i in /sys/devices/system/cpu/cpu*/cpuidle/state*/disable;do echo 1 > $i;done
+```
+Also, using HTM requires a kernel built with both `CONFIG_PPC_MEMTRACE=y`
+(v4.14) and `CONFIG_SCOM_DEBUGFS=y`. debugfs should be mounted at
+`/sys/kernel/debug`. Ubuntu 18.04 has this by default.
+
+#### How to run HTM
+
+pdbg provides a `htm` command with a variety of sub-commands. The most
 useful command is `record` which will start the trace, wait for buffer
-to fill (~1 sec), stop and then dump (~5 sec). eg.
+to fill (~1 sec), stop and then dump the trace to a file (~5 sec). eg.
+```
+pdbg -l 0 htm core record
+```
+pdbg -l allows users to specify CPUs using the same addressing as
+scheme as taskset -c. This can be useful for tracing workloads. eg.
 ```
-pdbg -p0 -c4 core htm record
+taskset -c 0 myworkload
+sleep 1
+pdbg -l 0 htm core record
 ```
-There are also low level commands which can also be used:
+There are also low level htm commands which can also be used:
  - `start` will configure the hardware and start tracing in wrapping mode.
- - `stop` will still stop the trace and deconfigure the hardware
- - `dump` will dump the trace to a file
+ - `stop` will still stop the trace and de-configure the hardware.
+ - `dump` will dump the trace to a file.
 
-If you are running into a checkstop issue, `htm status` will print the
-physical address of the buffer it is tracing into and the BMC can be
-used to recover this memory after checkstop see `getmem`.
-
-Using HTM requires a kernel built with both `CONFIG_PPC_MEMTRACE=y`
-(v4.14) and `CONFIG_SCOM_DEBUGFS=y`. debugfs should be mounted at
-`/sys/kernel/debug`. Ubuntu 18.04 has this by default.