From 4da070ce6c015a994ec4ecf3d31ee94810ea19f1 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Wed, 29 Jan 2025 02:03:02 +0000 Subject: [PATCH] dtrace/arm64: Fix enumeration of FBT return probes On arm64, the FBT provider treats tail calls as return probes. Ignoring the question of whether this is really correct, the implementation is wrong: instr is a pointer to uint32_t, so the removed multiplication by the instruction size is wrong. As a result, FBT would create return probes for intra-function branches. MFC after: 2 weeks Sponsored by: Innovate UK --- sys/cddl/dev/fbt/aarch64/fbt_isa.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/cddl/dev/fbt/aarch64/fbt_isa.c b/sys/cddl/dev/fbt/aarch64/fbt_isa.c index 4f6d28c2f32..ffe2f37a6d1 100644 --- a/sys/cddl/dev/fbt/aarch64/fbt_isa.c +++ b/sys/cddl/dev/fbt/aarch64/fbt_isa.c @@ -177,8 +177,7 @@ again: break; else if ((*instr & B_MASK) == B_INSTR) { offs = (*instr & B_DATA_MASK); - offs *= 4; - target = (instr + offs); + target = instr + offs; start = (uint32_t *)symval->value; if (target >= limit || target < start) break;