On 12.06.2026 17:14, Matt Turner wrote:
Add support for saving and restoring f0-f15 across signal delivery.
The target_xtensa_xtregs_fp struct carries 32-bit f-regs for cores
with XTENSA_OPTION_FP_COPROCESSOR; target_xtensa_xtregs_dfp carries
64-bit f-regs for cores with XTENSA_OPTION_DFP_COPROCESSOR.
Lock the xtregs region via lock_user before reading on sigreturn,
since sc_xtregs is a user-space pointer that may lie outside the
locked sigframe.
Now this is kind of fun.
@@ -282,7 +360,9 @@ long do_rt_sigreturn(CPUXtensaState *env)
target_to_host_sigset(&set, &frame->uc.tuc_sigmask);
set_sigmask(&set);
- restore_sigcontext(env, frame);
+ if (!restore_sigcontext(env, frame)) {
+ goto badframe;
+ }
There's another patch for linux-user/xtensa which is queued up for
the stable series:
54e08dbe8f linux-user/xtensa: fix unlock of uninitialized frame pointer
on sigreturn
This patch (fix unlock of frame pointer) removes `goto badframe` from
this same function. With that patch applied, the compiler complains:
linux-user/xtensa/signal.c: In function ‘do_rt_sigreturn’:
linux-user/xtensa/signal.c:293:1: error: label ‘badframe’ defined but
not used [-Werror=unused-label]
cc1: all warnings being treated as errors
and the build fails.
But this works on master because of this patch (6858e3a71c save/restore
FP registers").
So, I should either extend 54e08dbe8f in stable series to remove the
now-unused label, or include this 6858e3a71c change *too* (with the
previous 7e859bacea).
Does it hurt to pick 7e859bacea and 6858e3a71c to the stable series?
This feels like another bugfix too, but a bit more involved. And it
builds at passes all tests, at least.
Thanks,
/mjt