[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250722173829.984082-1-jesse@rivosinc.com>
Date: Tue, 22 Jul 2025 10:38:23 -0700
From: Jesse Taube <jesse@...osinc.com>
To: linux-riscv@...ts.infradead.org,
linux-kernel@...r.kernel.org
Cc: Paul Walmsley <paul.walmsley@...ive.com>,
Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>,
Alexandre Ghiti <alex@...ti.fr>,
Oleg Nesterov <oleg@...hat.com>,
Jesse Taube <jesse@...osinc.com>,
Himanshu Chauhan <hchauhan@...tanamicro.com>,
Charlie Jenkins <charlie@...osinc.com>,
Samuel Holland <samuel.holland@...ive.com>,
Deepak Gupta <debug@...osinc.com>,
Andrew Jones <ajones@...tanamicro.com>,
Atish Patra <atishp@...osinc.com>,
Anup Patel <apatel@...tanamicro.com>,
Mayuresh Chitale <mchitale@...tanamicro.com>,
Conor Dooley <conor.dooley@...rochip.com>,
WangYuli <wangyuli@...ontech.com>,
Huacai Chen <chenhuacai@...nel.org>,
Nam Cao <namcao@...utronix.de>,
Andrew Morton <akpm@...ux-foundation.org>,
"Mike Rapoport (Microsoft)" <rppt@...nel.org>,
Luis Chamberlain <mcgrof@...nel.org>,
Yunhui Cui <cuiyunhui@...edance.com>,
Joel Granados <joel.granados@...nel.org>,
Clément Léger <cleger@...osinc.com>,
Celeste Liu <coelacanthushex@...il.com>,
Evan Green <evan@...osinc.com>,
Nylon Chen <nylon.chen@...ive.com>
Subject: [RFC PATCH 0/6] riscv: add initial support for hardware breakpoints
This patchset adds initial support for hardware breakpoints and
watchpoints to the RISC-V architecture. The framework is built on
top of perf subsystem and SBI debug trigger extension.
Currently following features are not supported and are in works:
- Ptrace regset support
- Virtualization of debug triggers
The SBI debug trigger extension can be found at:
https://github.com/riscv-non-isa/riscv-sbi-doc/blob/master/src/ext-debug-triggers.adoc
The Sdtrig ISA is part of RISC-V debug specification which can be
found at:
https://github.com/riscv/riscv-debug-spec
based off the original RFC by Himanshu Chauhan here:
https://lore.kernel.org/lkml/20240222125059.13331-1-hchauhan@ventanamicro.com/
Himanshu Chauhan (2):
riscv: Add SBI debug trigger extension and function ids
riscv: Introduce support for hardware break/watchpoints
Jesse Taube (4):
riscv: Add insn.c, consolidate instruction decoding
riscv: insn: __read_insn use copy_from_X_nofault
riscv: hw_breakpoint: Use icount for single stepping
riscv: ptrace: Add hw breakpoint support
arch/riscv/Kconfig | 12 +
arch/riscv/include/asm/bug.h | 12 -
arch/riscv/include/asm/hw_breakpoint.h | 60 +++
arch/riscv/include/asm/insn.h | 131 ++++-
arch/riscv/include/asm/kdebug.h | 3 +-
arch/riscv/include/asm/processor.h | 4 +
arch/riscv/include/asm/sbi.h | 33 +-
arch/riscv/include/uapi/asm/ptrace.h | 3 +-
arch/riscv/kernel/Makefile | 2 +
arch/riscv/kernel/hw_breakpoint.c | 681 +++++++++++++++++++++++++
arch/riscv/kernel/insn.c | 153 ++++++
arch/riscv/kernel/kgdb.c | 102 +---
arch/riscv/kernel/probes/kprobes.c | 1 +
arch/riscv/kernel/process.c | 4 +
arch/riscv/kernel/ptrace.c | 93 ++++
arch/riscv/kernel/traps.c | 11 +-
arch/riscv/kernel/traps_misaligned.c | 93 +---
17 files changed, 1208 insertions(+), 190 deletions(-)
create mode 100644 arch/riscv/include/asm/hw_breakpoint.h
create mode 100644 arch/riscv/kernel/hw_breakpoint.c
create mode 100644 arch/riscv/kernel/insn.c
--
2.43.0
Powered by blists - more mailing lists