Re: [PATCH v4 05/25] linux-user/arm: Implement setup_sigtramp

2021-09-28 Thread Richard Henderson
On 9/28/21 5:31 AM, Peter Maydell wrote: +uint32_t *host_rc = g2h_untagged(retcode); ...but here we treat it as a normal guest address that we can convert into a host address and dereference. If the signal handler is being entered in Thumb mode this will be a misaligned pointer. Oops,

Re: [PATCH v4 05/25] linux-user/arm: Implement setup_sigtramp

2021-09-28 Thread Peter Maydell
On Tue, 28 Sept 2021 at 03:00, Richard Henderson wrote: > > Mirror what the kernel does in arch/arm/kernel/signal.h, > using the old sigframe struct in the rt sigframe struct. > > Update the trampoline code to match the kernel: this uses > sp-relative accesses rather than pc-relative. > > Copy the

[PATCH v4 05/25] linux-user/arm: Implement setup_sigtramp

2021-09-27 Thread Richard Henderson
Mirror what the kernel does in arch/arm/kernel/signal.h, using the old sigframe struct in the rt sigframe struct. Update the trampoline code to match the kernel: this uses sp-relative accesses rather than pc-relative. Copy the code into frame->retcode from the trampoline page. This minimises the