Page MenuHomeFreeBSD

kinst/arm64: Fix return values from kinst_invop()
ClosedPublic

Authored by markj on May 13 2026, 4:04 PM.
Tags
None
Referenced Files
F174207886: D56987.id177833.diff
Thu, Oct 1, 9:13 AM
F174141058: D56987.diff
Wed, Sep 30, 9:20 PM
F174133128: D56987.diff
Wed, Sep 30, 8:12 PM
Unknown Object (File)
Mon, Sep 28, 11:52 PM
Unknown Object (File)
Mon, Sep 28, 11:26 PM
Unknown Object (File)
Mon, Sep 28, 11:23 PM
Unknown Object (File)
Fri, Sep 18, 11:28 AM
Unknown Object (File)
Mon, Sep 14, 9:44 PM
Subscribers

Details

Summary

After commit 853cd8723494 it became invalid for kinst_invop() to return
0: dtrace_invop_start() would convert this to a sentinel value
indicating that it did not consume the breakpoint, and so we'd just
call kdb_trap() to handle it.

Change kinst_invop() to return NOP_INSTR after handling a matching
breakpoint. NOP_INSTR is handled by advancing the ELR, so we have to
compensate by subtracting INSTR_SIZE before returning.

Fixes: 853cd8723494 ("arm64: Clean up usage of the dtrace invop handler")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 73099
Build 69982: arc lint + arc unit

Event Timeline

markj requested review of this revision.May 13 2026, 4:04 PM
sys/cddl/dev/kinst/aarch64/kinst_isa.c
233–234

I think it'd be good to include the explanation from the commit message here as well. After a while it might not be obvious what we meant here.

sys/cddl/dev/kinst/aarch64/kinst_isa.c
233–234

It seems pretty clear if one actually looks at dtrace_invop_start()...?

sys/cddl/dev/kinst/aarch64/kinst_isa.c
233–234

Yes, I just thought it might be handy to have a short explanation here as well.

This revision is now accepted and ready to land.May 14 2026, 3:56 PM