Page MenuHomeFreeBSD

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

Authored by markj on Wed, May 13, 4:04 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jun 10, 4:48 AM
Unknown Object (File)
Wed, Jun 10, 4:12 AM
Unknown Object (File)
Mon, Jun 8, 10:12 AM
Unknown Object (File)
Fri, Jun 5, 12:02 PM
Unknown Object (File)
Fri, Jun 5, 12:00 PM
Unknown Object (File)
Fri, Jun 5, 11:26 AM
Unknown Object (File)
Fri, Jun 5, 11:22 AM
Unknown Object (File)
Fri, Jun 5, 9:15 AM
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 Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj requested review of this revision.Wed, May 13, 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.Thu, May 14, 3:56 PM