> -----Original Message-----
> From: Richard Henderson <richard.hender...@linaro.org>
> Sent: Tuesday, June 15, 2021 7:12 PM
> To: qemu-devel@nongnu.org
> Cc: laur...@vivier.eu; alex.ben...@linaro.org; Taylor Simpson
> <tsimp...@quicinc.com>
> Subject: [PATCH 07/21] linux-user/hexagon: Implement setup_sigtramp
>
> Continue to initialize the words on the stack, as documented.
> However, use the off-stack trampoline.
>
> Cc: Taylor Simpson <tsimp...@quicinc.com>
> Signed-off-by: Richard Henderson <richard.hender...@linaro.org>
>
> diff --git a/linux-user/hexagon/signal.c b/linux-user/hexagon/signal.c index
> 85eab5e943..bd0f9b1c85 100644
> --- a/linux-user/hexagon/signal.c
> +++ b/linux-user/hexagon/signal.c
> @@ -161,6 +161,11 @@ void setup_rt_frame(int sig, struct target_sigaction
> *ka,
>
> setup_ucontext(&frame->uc, env, set);
> tswap_siginfo(&frame->info, info);
> + /*
> + * The on-stack signal trampoline is no longer executed;
> + * however, the libgcc signal frame unwinding code checks
> + * for the presence of these two numeric magic values.
> + */
Hexagon uses musl, not libgcc. So, I'm not sure if this is needed. The
signals.c test passes for me without this change. Are you seeing it fail?
> +void setup_sigtramp(abi_ulong sigtramp_page) {
> + uint32_t *tramp = lock_user(VERIFY_WRITE, sigtramp_page, 4 * 2, 0);
> + assert(tramp != NULL);
> +
> + default_rt_sigreturn = sigtramp_page;
> + install_sigtramp(tramp);
> +
> + unlock_user(tramp, sigtramp_page, 4 * 2); }
Put the closing curly on a new line.
Thanks,
Taylor