diff options
author | Stefan Liebler <stli@linux.ibm.com> | 2022-08-25 12:17:48 +0200 |
---|---|---|
committer | Stefan Liebler <stli@linux.ibm.com> | 2022-08-30 10:54:46 +0200 |
commit | e57d8fc97b90127de4ed3e3a9cdf663667580935 (patch) | |
tree | f6b33a78454ea861ddef36b3ed8eb28289094f28 /sysdeps/unix/sysv/linux/s390/s390-64/setcontext.S | |
parent | 1d495912a746e2a1ffb780c9a81fd234ec2464e8 (diff) | |
download | glibc-e57d8fc97b90127de4ed3e3a9cdf663667580935.tar glibc-e57d8fc97b90127de4ed3e3a9cdf663667580935.tar.gz glibc-e57d8fc97b90127de4ed3e3a9cdf663667580935.tar.bz2 glibc-e57d8fc97b90127de4ed3e3a9cdf663667580935.zip |
S390: Always use svc 0
On s390x syscalls are triggered by svc instruction. One can
pass the syscall number encoded in the instruction "svc 123"
or by storing it in r1:
lghi r1,123
svc 0
If the syscall number is encoded in the instruction, this can
cause broken syscall restarts. Therefore this patch is now just
passing the syscall number in r1.
See also kernel-commit:
"s390/signal: switch to using vdso for sigreturn and syscall restart"
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/s390/[%e2%80%a6]call.c?h=v6.0-rc1&id=df29a7440c4b5c65765c8f60396b3b13063e24e9
As information, the "svc 0" feature was introduced in kernel 2.5.62:
commit b5aad611393ef2e132e3648fa4c6e56a9cfa8708
Diffstat (limited to 'sysdeps/unix/sysv/linux/s390/s390-64/setcontext.S')
-rw-r--r-- | sysdeps/unix/sysv/linux/s390/s390-64/setcontext.S | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/setcontext.S b/sysdeps/unix/sysv/linux/s390/s390-64/setcontext.S index b5626b686e..3e32370236 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/setcontext.S +++ b/sysdeps/unix/sysv/linux/s390/s390-64/setcontext.S @@ -30,16 +30,18 @@ other than the PRESERVED state. */ ENTRY(__setcontext) - lgr %r1,%r2 + lgr %r0,%r2 /* sigprocmask (SIG_SETMASK, &sc->sc_mask, NULL). */ + la %r3,SC_MASK(%r2) la %r2,SIG_SETMASK - la %r3,SC_MASK(%r1) slgr %r4,%r4 lghi %r5,_NSIG8 - svc SYS_ify(rt_sigprocmask) + lghi %r1,SYS_ify(rt_sigprocmask) + svc 0 /* Load fpu context. */ + lgr %r1,%r0 lfpc SC_FPC(%r1) ld %f0,SC_FPRS(%r1) ld %f1,SC_FPRS+8(%r1) |