git: 4588b6358ab1 - main - fbt/powerpc: don't instrument the trap entry path
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 20 Nov 2026 09:34:36 UTC
The branch main has been updated by pkubaj:
URL: https://cgit.FreeBSD.org/src/commit/?id=4588b6358ab140be5553377ec203b65d5f1d0728
commit 4588b6358ab140be5553377ec203b65d5f1d0728
Author: Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2026-09-21 19:48:04 +0000
Commit: Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2026-11-20 09:34:28 +0000
fbt/powerpc: don't instrument the trap entry path
On powerpc an fbt probe is a program interrupt that goes through the
normal trap path, powerpc_interrupt() -> trap() -> dtrace_trap(). A
probe on trap() or powerpc_interrupt() fires again on the way to its
own handler, so it recurses until the kernel stack runs out, and
enabling fbt::trap:entry panics the machine right away.
Skip both functions, like aarch64 and riscv skip their exception
handlers.
Reviewed by: jhibbits
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D61660
---
sys/cddl/dev/fbt/powerpc/fbt_isa.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/sys/cddl/dev/fbt/powerpc/fbt_isa.c b/sys/cddl/dev/fbt/powerpc/fbt_isa.c
index d0b3ccdeb906..ebfc9ac8acfa 100644
--- a/sys/cddl/dev/fbt/powerpc/fbt_isa.c
+++ b/sys/cddl/dev/fbt/powerpc/fbt_isa.c
@@ -127,6 +127,13 @@ fbt_provide_module_function(linker_file_t lf, int symindx,
if (fbt_excluded(name))
return (0);
+ /*
+ * fbt probes are delivered through trap(), so instrumenting the
+ * trap entry path would make them recurse.
+ */
+ if (strcmp(name, "trap") == 0 || strcmp(name, "powerpc_interrupt") == 0)
+ return (0);
+
instr = (uint32_t *) symval->value;
limit = (uint32_t *) (symval->value + symval->size);