diff --git a/sys/cddl/dev/kinst/amd64/kinst_isa.c b/sys/cddl/dev/kinst/amd64/kinst_isa.c --- a/sys/cddl/dev/kinst/amd64/kinst_isa.c +++ b/sys/cddl/dev/kinst/amd64/kinst_isa.c @@ -516,9 +516,8 @@ /* * Ignore functions not beginning with the usual function prologue. - * These might correspond to exception handlers with which we should not - * meddle. This does however exclude functions which can be safely - * traced, such as cpu_switch(). + * These might correspond to exception handlers with which we should + * not meddle. */ if (*instr != KINST_PUSHL_RBP) return (0); diff --git a/sys/cddl/dev/kinst/kinst.c b/sys/cddl/dev/kinst/kinst.c --- a/sys/cddl/dev/kinst/kinst.c +++ b/sys/cddl/dev/kinst/kinst.c @@ -96,6 +96,13 @@ if (kinst_md_excluded(name)) return (true); + /* + * cpu_switch() can cause a crash if it modifies the value of curthread + * while in probe context. + */ + if (strcmp(name, "cpu_switch") == 0) + return (true); + /* * Anything beginning with "dtrace_" may be called from probe context * unless it explicitly indicates that it won't be called from probe