All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] riscv: kgdb: Fix break size, insn patch and masking
@ 2026-11-13  7:16 ` Clément Léger
  0 siblings, 0 replies; 8+ messages in thread
From: Clément Léger @ 2026-11-13  7:16 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou
  Cc: Clément Léger, Alexandre Ghiti, WangYuli, linux-riscv,
	linux-kernel

This small series fixes a few problems that were spotted with kgdb.

First patch is the use of patch_insn_write() to set breakpoints instead
of copy_to_kernel_nofault(). This fixes the use of kgdb with
CONFIG_STRICT_KERNEL_RWX which maps text as RX.

Second patch removes the hardcoded epc += 4 with BREAK_INSTR_SIZE so
that it works with CONFIG_RISCV_ISA_C.

Last one is more of a correctness fix with respect to jalr instructions.
ISA specifies that the target address is computed by masking the LSB to
0.

Clément Léger (3):
  riscv: kgdb: use patch_insn_write() to set breakpoints
  riscv: kgdb: use BREAK_INSTR_SIZE instead of hardcoded value
  riscv: kgdb: clear bit 0 of single-step jump targets

 arch/riscv/kernel/kgdb.c | 39 ++++++++++++++++++++++++++++++++-------
 1 file changed, 32 insertions(+), 7 deletions(-)

-- 
Clément Léger

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-11-13  7:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-13  7:16 [PATCH 0/3] riscv: kgdb: Fix break size, insn patch and masking Clément Léger
2026-11-13  7:16 ` Clément Léger
2026-11-13  7:16 ` [PATCH 1/3] riscv: kgdb: use patch_insn_write() to set breakpoints Clément Léger
2026-11-13  7:16   ` Clément Léger
2026-11-13  7:16 ` [PATCH 2/3] riscv: kgdb: use BREAK_INSTR_SIZE instead of hardcoded value Clément Léger
2026-11-13  7:16   ` Clément Léger
2026-11-13  7:16 ` [PATCH 3/3] riscv: kgdb: clear bit 0 of single-step jump targets Clément Léger
2026-11-13  7:16   ` Clément Léger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.