[PATCH] s390: Set psw addr field in getcontext and friends.
Florian Weimer
fweimer@redhat.com
Mon Dec 18 14:18:23 GMT 2023
* Stefan Liebler:
> So far if the ucontext structure was obtained by getcontext and co,
> the return address was stored in general purpose register 14 as
> it is defined as return address in the ABI.
>
> In contrast, the context passed to a signal handler contains the address
> in psw.addr field.
>
> If somebody e.g. wants to dump the address of the context, the origin
> needs to be known.
>
> Now this patch adjusts getcontext and friends and stores the return address
> also in psw.addr field.
>
> Note that setcontext isn't adjusted and it is not supported to pass a
> ucontext structure from signal-handler to setcontext. We are not able to
> restore all registers and branching to psw.addr without clobbering one
> register.
> ---
> sysdeps/unix/sysv/linux/s390/s390-32/getcontext.S | 6 ++++++
> sysdeps/unix/sysv/linux/s390/s390-32/makecontext.c | 5 +++++
> sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S | 6 ++++++
> sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S | 6 ++++++
> sysdeps/unix/sysv/linux/s390/s390-64/makecontext.c | 5 +++++
> sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S | 6 ++++++
> 6 files changed, 34 insertions(+)
I guess this makes sense. Please feel empowered to push this as the
S/390 maintainer.
Thanks,
Florian
More information about the Libc-alpha
mailing list