Skip to content

Introduce support for SBI Debug Trigger Extension

Himanshu Chauhan opensbi 3 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest8 patches 0 repliesNew
  2. v27 patches 0 repliesSuperseded
  3. v17 patches 0 repliesSuperseded

Changes in v3 from the cover letter

- Detection of sdtrig support (via trap and ISA string)
- Removed redundant functions (sdtrig supports and get total triggers)
- Removed check for S-mode
- Skip the debug trigger probing if already probed for CPU (warm boot)

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8include: sbi: Introduce common endianess conversion macroinclude/sbi/sbi_byteorder.h+10 -00 replies
2/8include: sbi: Add TINFO debug trigger CSRinclude/sbi/riscv_encoding.h+1 -00 replies
3/8include: sbi: Introduce debug trigger register encodingsinclude/sbi/riscv_dbtr.h+249 -00 replies
4/8lib: sbi: Detect support of debug triggersinclude/sbi/sbi_hart.h lib/sbi/sbi_hart.c+6 -01 reply
5/8lib: sbi: Introduce the SBI debug triggers extension supportinclude/sbi/sbi_dbtr.h lib/sbi/objects.mk lib/sbi/sbi_dbtr.c +1 more+877 -00 replies
6/8include: sbi: Add SBI debug trigger extension related definesinclude/sbi/sbi_ecall_interface.h+11 -00 replies
7/8lib: sbi: Implement SBI debug trigger extensionlib/sbi/Kconfig lib/sbi/objects.mk lib/sbi/sbi_ecall_dbtr.c+80 -00 replies
8/8lib: sbi: Print number of debug triggers foundlib/sbi/sbi_init.c+2 -00 replies

Reviews trailers per patch

All 8 patches have a Reviewed-by or Acked-by.

PatchAnup Patel
1/8R-b
2/8R-b
3/8R-b
4/8R-b
5/8R-b
6/8R-b
7/8R-b
8/8R-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/8] Introduce support for SBI Debug Trigger Extension

RISC-V Debug specification includes Sdtrig ISA extension which describes Trigger Module. Triggers can cause a breakpoint exception or trace action without execution of a special instruction. They can be used to implement hardware breakpoints and watchpoints for native debugging.

The SBI Debug Trigger extension v6 can be found at:
https://lists.riscv.org/g/tech-debug/topic/99825362#1302

This patch is an initial implementation of SBI Debug Trigger Extension(v6) in OpenSBI. It is based on similar patchset from Sergey Matyukevich.
(http://lists.infradead.org/pipermail/opensbi/2022-October/003531.html)

The following features are supported:
* mcontrol, mcontrol6 triggers
* Breakpoint and trace actions

Linux Kernel Branch (Breakpoint driver support):
https://github.com/hschauhan/riscv-linux/tree/sdtrig-v6

NOTE: Chained triggers are not supported

Changes from v2:
- Detection of sdtrig support (via trap and ISA string)
- Removed redundant functions (sdtrig supports and get total triggers)
- Removed check for S-mode
- Skip the debug trigger probing if already probed for CPU (warm boot)

Changes from v1:
- Rebased to latest OpenSBI master
- Other cosmetic changes as per the comments

Himanshu Chauhan (8):
include: sbi: Introduce common endianess conversion macro
include: sbi: Add TINFO debug trigger CSR
include: sbi: Introduce debug trigger register encodings
lib: sbi: Detect support of debug triggers
lib: sbi: Introduce the SBI debug triggers extension support
include: sbi: Add SBI debug trigger extension related defines
lib: sbi: Implement SBI debug trigger extension
lib: sbi: Print number of debug triggers found

 include/sbi/riscv_dbtr.h          | 249 ++++++++++
 include/sbi/riscv_encoding.h      |   1 +
 include/sbi/sbi_byteorder.h       |  10 +
 include/sbi/sbi_dbtr.h            | 128 ++++++
 include/sbi/sbi_ecall_interface.h |  11 +
 include/sbi/sbi_hart.h            |   2 +
 lib/sbi/Kconfig                   |   4 +
 lib/sbi/objects.mk                |   4 +
 lib/sbi/sbi_dbtr.c                | 739 ++++++++++++++++++++++++++++++
 lib/sbi/sbi_ecall_dbtr.c          |  73 +++
 lib/sbi/sbi_hart.c                |   4 +
 lib/sbi/sbi_init.c                |  11 +
 12 files changed, 1236 insertions(+)
 create mode 100644 include/sbi/riscv_dbtr.h
 create mode 100644 include/sbi/sbi_dbtr.h
 create mode 100644 lib/sbi/sbi_dbtr.c
 create mode 100644 lib/sbi/sbi_ecall_dbtr.c
Signature · 1 line
2.34.1