Date: Sat, 12 May 2018 15:35:27 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333570 - head/sys/cddl/dev/dtrace/aarch64 Message-ID: <201805121535.w4CFZRal032082@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Sat May 12 15:35:26 2018 New Revision: 333570 URL: https://svnweb.freebsd.org/changeset/base/333570 Log: DTrace aarch64: Avoid calling unwind_frame() in the probe context. unwind_frame() may be instrumented by FBT, leading to recursion into dtrace_probe(). Manually inline unwind_frame() as we do with stack unwinding code for other architectures. Submitted by: Domagoj Stolfa Reviewed by: manu MFC after: 1 week Sponsored by: DARPA / AFRL Differential Revision: https://reviews.freebsd.org/D15359 Modified: head/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c Modified: head/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c ============================================================================== --- head/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c Sat May 12 15:34:35 2018 (r333569) +++ head/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c Sat May 12 15:35:26 2018 (r333570) @@ -70,7 +70,7 @@ dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, in { struct unwind_state state; int scp_offset; - register_t sp; + register_t sp, fp; int depth; depth = 0; @@ -88,11 +88,15 @@ dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, in state.pc = (uint64_t)dtrace_getpcstack; while (depth < pcstack_limit) { - if (unwind_frame(&state)) - break; - if (!INKERNEL(state.pc) || !INKERNEL(state.fp)) break; + + fp = state.fp; + state.sp = fp + 0x10; + /* FP to previous frame (X29) */ + state.fp = *(register_t *)(fp); + /* LR (X30) */ + state.pc = *(register_t *)(fp + 8) - 4; /* * NB: Unlike some other architectures, we don't need to
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201805121535.w4CFZRal032082>