The branch stable/15 has been updated by pkubaj:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=234bc2159be3334aef5f1fc97567fe9eea3a40ff

commit 234bc2159be3334aef5f1fc97567fe9eea3a40ff
Author:     Piotr Kubaj <[email protected]>
AuthorDate: 2026-09-21 19:48:04 +0000
Commit:     Piotr Kubaj <[email protected]>
CommitDate: 2026-12-02 17:30:21 +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
    
    (cherry picked from commit 4588b6358ab140be5553377ec203b65d5f1d0728)
---
 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);
 

Reply via email to