mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/4] sparc64: kprobes: Make kprobes work on sun4v
@ 2026-10-09 18:03 Stian Halseth
  2026-10-09 18:03 ` [PATCH 1/4] sparc64: kprobes: Single-step from an executable instruction slot Stian Halseth
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Stian Halseth @ 2026-10-09 18:03 UTC (permalink / raw)
  To: David S. Miller, Andreas Larsson
  Cc: Masami Hiramatsu, Naveen N Rao, sparclinux, linux-trace-kernel,
	linux-kernel, Stian Halseth

Any kprobe hit on a sun4v machine oopses, because the probed
instruction is single-stepped from memory that is not executable there.
Patch 1 moves the copy into an instruction slot from get_insn_slot(),
as other architectures do.

Once probes work, three older single-step bugs show up: a taken BPr or
FP branch resumes at the wrong address (patch 2), so does a probe on a
delay slot instruction (patch 3), and an annulled branch can skip the
break instruction after the copy (patch 4).

Tested on a SPARC T7-1 and T4-1 (sun4v) and a Sun Fire V240 (sun4u):
entry and return probes, probes on all 50 instructions of
__task_pid_nr_ns at once while checking getppid(), ps and /proc, probes
on the SPARC AES routines during AF_ALG encryption (sun4v), and refusal
of ba,a. Without the series the first probe hit oopses on sun4v, and a
probe on a taken brnz oopses on sun4u as well.

Stian Halseth (4):
  sparc64: kprobes: Single-step from an executable instruction slot
  sparc64: kprobes: Fix up register and FP branches after single-step
  sparc64: kprobes: Resume after a delay slot at the saved next PC
  sparc64: kprobes: Handle annulled branches

 arch/sparc/include/asm/kprobes.h | 10 +++--
 arch/sparc/kernel/kprobes.c      | 69 +++++++++++++++++++++++++++-----
 2 files changed, 66 insertions(+), 13 deletions(-)


base-commit: af32da41b0327b9c6a37856ba82b6760d6c8d10e
-- 
2.43.0


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

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

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-09 18:03 [PATCH 0/4] sparc64: kprobes: Make kprobes work on sun4v Stian Halseth
2026-10-09 18:03 ` [PATCH 1/4] sparc64: kprobes: Single-step from an executable instruction slot Stian Halseth
2026-11-13  9:32   ` Masami Hiramatsu (Google)
2026-11-13 11:09     ` Stian Halseth
2026-10-09 18:03 ` [PATCH 2/4] sparc64: kprobes: Fix up register and FP branches after single-step Stian Halseth
2026-10-09 18:03 ` [PATCH 3/4] sparc64: kprobes: Resume after a delay slot at the saved next PC Stian Halseth
2026-10-09 18:03 ` [PATCH 4/4] sparc64: kprobes: Handle annulled branches Stian Halseth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®