Index: sys/arm64/linux/linux_machdep.c =================================================================== --- sys/arm64/linux/linux_machdep.c +++ sys/arm64/linux/linux_machdep.c @@ -52,7 +52,6 @@ LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); /* DTrace probes */ -LIN_SDT_PROBE_DEFINE0(machdep, linux_set_upcall, todo); LIN_SDT_PROBE_DEFINE0(machdep, linux_mmap2, todo); LIN_SDT_PROBE_DEFINE0(machdep, linux_rt_sigsuspend, todo); LIN_SDT_PROBE_DEFINE0(machdep, linux_sigaltstack, todo); @@ -84,13 +83,19 @@ return (error); } -/* LINUXTODO: implement (or deduplicate) arm64 linux_set_upcall */ int linux_set_upcall(struct thread *td, register_t stack) { - LIN_SDT_PROBE0(machdep, linux_set_upcall, todo); - return (EDOOFUS); + if (stack) + td->td_frame->tf_sp = stack; + + /* + * The newly created Linux thread returns + * to the user space by the same path that a parent does. + */ + td->td_frame->tf_x[0] = 0; + return (0); } /* LINUXTODO: deduplicate arm64 linux_mmap2 */