aboutsummaryrefslogtreecommitdiff
path: root/sys/cddl/dev
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2020-04-21 17:38:07 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2020-04-21 17:38:07 +0000
commit5c4309b4749d3984eb64e8d2f16408e5cee9ff4b (patch)
treeb33afb78dc75eb671c79982377f2c3d71dbc2b9f /sys/cddl/dev
parent0c0119856bcaa27c3d2aa5c0c4a1dd614e0a0eac (diff)
downloadsrc-5c4309b4749d3984eb64e8d2f16408e5cee9ff4b.tar.gz
src-5c4309b4749d3984eb64e8d2f16408e5cee9ff4b.zip
Handle non-dtrace-triggered kernel breakpoint traps in mips.
If DTRACE is enabled at compile time, all kernel breakpoint traps are first given to dtrace to see if they are triggered by a FBT probe. Previously if dtrace didn't recognize the trap, it was silently ignored breaking the handling of other kernel breakpoint traps such as the debug.kdb.enter sysctl. This only returns early from the trap handler if dtrace recognizes the trap and handles it. Submitted by: Nicolò Mazzucato <nicomazz97@gmail.com> Reviewed by: markj Obtained from: CheriBSD Differential Revision: https://reviews.freebsd.org/D24478
Notes
Notes: svn path=/head/; revision=360168
Diffstat (limited to 'sys/cddl/dev')
-rw-r--r--sys/cddl/dev/dtrace/mips/dtrace_subr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/cddl/dev/dtrace/mips/dtrace_subr.c b/sys/cddl/dev/dtrace/mips/dtrace_subr.c
index 56ae129370fd..c5ebe778b82d 100644
--- a/sys/cddl/dev/dtrace/mips/dtrace_subr.c
+++ b/sys/cddl/dev/dtrace/mips/dtrace_subr.c
@@ -251,6 +251,9 @@ dtrace_invop_start(struct trapframe *frame)
int invop;
invop = dtrace_invop(frame->pc, frame, frame->pc);
+ if (invop == 0)
+ return (-1);
+
offs = (invop & LDSD_DATA_MASK);
sp = (register_t *)((uint8_t *)frame->sp + offs);