From e57d8fc97b90127de4ed3e3a9cdf663667580935 Mon Sep 17 00:00:00 2001 From: Stefan Liebler Date: Thu, 25 Aug 2022 12:17:48 +0200 Subject: 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 --- sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S') diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S b/sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S index def4e8b163..b75bf7596b 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S +++ b/sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S @@ -73,7 +73,8 @@ ENTRY(__swapcontext) la %r3,SC_MASK(%r5) la %r4,SC_MASK(%r1) lhi %r5,_NSIG8 - svc SYS_ify(rt_sigprocmask) + lhi %r1,SYS_ify(rt_sigprocmask) + svc 0 /* Load fpu context. */ lr %r5,%r0 -- cgit 1.4.1