From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 9893B3858D20 for ; Tue, 11 Apr 2023 13:56:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9893B3858D20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33BDPssK005595; Tue, 11 Apr 2023 13:56:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : subject : to : references : from : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pp1; bh=oSqfcUaMkW9QnIxjTSJ92GpgFqh1aDz7xV5WQIK1NMo=; b=rspfIwDx+Jml9UaB+Oayfb7l1+yc6/dNVy9i5f1x/Nn7xV9RvWukUl2B5n82zZiNd74m kcuJHQ62ohl7bHPnVTYzXdt9XECiYfelVMmSMyhkMrAk0y98jRhaLWhl7BOQidlkRjCi 06uewKePCcZvoL/43b+QzgnOqpnspe/ImdNRU1nTv3cCivyty1IwdzLOtUIAOQioo12z rrvbz23BA13w+RFeNiBiGyPjOjlMKw5XUcNSnyrvkr5VAOJtmjLCqRPbspLYi1s6k/44 GsUl2hd2fMrbjXMR1ju/A/YGnrGMSChndYzqqZ+poHDQ8aeJHVKSmwfxS6snpzjPM62R hA== Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pw7pf3gpq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 11 Apr 2023 13:56:40 +0000 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 33ALkoVm016063; Tue, 11 Apr 2023 13:56:38 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma03ams.nl.ibm.com (PPS) with ESMTPS id 3pu0hdhrs3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 11 Apr 2023 13:56:38 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 33BDuagI30671498 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 11 Apr 2023 13:56:36 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7018D2004E; Tue, 11 Apr 2023 13:56:36 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3BB6F2004B; Tue, 11 Apr 2023 13:56:36 +0000 (GMT) Received: from [9.171.63.188] (unknown [9.171.63.188]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 11 Apr 2023 13:56:36 +0000 (GMT) Message-ID: <1a7ae677-9e0e-24bf-3eee-62e81c988797@linux.ibm.com> Date: Tue, 11 Apr 2023 15:56:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [PATCH v5 09/22] s390: Fix Race conditions in pthread cancellation [BZ#12683] Content-Language: en-US To: Adhemerval Zanella , libc-alpha@sourceware.org References: <20230410195907.4123869-1-adhemerval.zanella@linaro.org> <20230410204614.4129551-1-adhemerval.zanella@linaro.org> From: Stefan Liebler In-Reply-To: <20230410204614.4129551-1-adhemerval.zanella@linaro.org> Content-Type: text/plain; charset=UTF-8 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: uiD8iqnLGhJby7xHD9dQ5fDHg8xjATZf X-Proofpoint-GUID: uiD8iqnLGhJby7xHD9dQ5fDHg8xjATZf Content-Transfer-Encoding: 7bit X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-11_08,2023-04-11_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 clxscore=1011 mlxlogscore=999 spamscore=0 malwarescore=0 lowpriorityscore=0 suspectscore=0 impostorscore=0 priorityscore=1501 mlxscore=0 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304110126 X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,NICE_REPLY_A,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 10.04.23 22:46, Adhemerval Zanella wrote: > By adding the required syscall_cancel.S. > > Checked on s390-linux-gnu and s390x-linux-gnu. > > Co-authored-by: Stefan Liebler > --- > .../sysv/linux/s390/s390-32/syscall_cancel.S | 62 +++++++++++++++++++ > .../sysv/linux/s390/s390-64/syscall_cancel.S | 62 +++++++++++++++++++ > 2 files changed, 124 insertions(+) > create mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/syscall_cancel.S > create mode 100644 sysdeps/unix/sysv/linux/s390/s390-64/syscall_cancel.S > > diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/syscall_cancel.S b/sysdeps/unix/sysv/linux/s390/s390-32/syscall_cancel.S > new file mode 100644 > index 0000000000..9e0ad2a635 > --- /dev/null > +++ b/sysdeps/unix/sysv/linux/s390/s390-32/syscall_cancel.S > @@ -0,0 +1,62 @@ > +/* Cancellable syscall wrapper. Linux/s390 version. > + Copyright (C) 2023 Free Software Foundation, Inc. > + This file is part of the GNU C Library. > + > + The GNU C Library is free software; you can redistribute it and/or > + modify it under the terms of the GNU Lesser General Public > + License as published by the Free Software Foundation; either > + version 2.1 of the License, or (at your option) any later version. > + > + The GNU C Library is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + Lesser General Public License for more details. > + > + You should have received a copy of the GNU Lesser General Public > + License along with the GNU C Library; if not, see > + . */ > + > +#include > +#include > + > +/* long int __syscall_cancel_arch (int *cancelhandling, > + __syscall_arg_t nr, > + __syscall_arg_t arg1, > + __syscall_arg_t arg2, > + __syscall_arg_t arg3, > + __syscall_arg_t arg4, > + __syscall_arg_t arg5, > + __syscall_arg_t arg6) */ > + > +ENTRY (__syscall_cancel_arch) > + stm %r6,%r7,24(%r15) > + cfi_offset (%r6, -72) > + cfi_offset (%r7, -68) > + > + .globl __syscall_cancel_arch_start > +__syscall_cancel_arch_start: > + /* if (*cancelhandling & CANCELED_BITMASK) > + __syscall_do_cancel() */ > + tm 3(%r2),TCB_CANCELED_BITMASK > + jne 1f > + > + /* Issue a 6 argument syscall, the nr [%r1] being the syscall > + number. */ > + lr %r1,%r3 > + lr %r2,%r4 > + lr %r3,%r5 > + lr %r4,%r6 > + lm %r5,%r7,96(%r15) > + svc 0 > + > + .globl __syscall_cancel_arch_end > +__syscall_cancel_arch_end: > + lm %r6,%r7,24(%r15) > + cfi_remember_state > + cfi_restore (%r7) > + cfi_restore (%r6) > + br %r14 > +1: > + cfi_restore_state > + jg __syscall_do_cancel > +END (__syscall_cancel_arch) > diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/syscall_cancel.S b/sysdeps/unix/sysv/linux/s390/s390-64/syscall_cancel.S > new file mode 100644 > index 0000000000..e1620add6a > --- /dev/null > +++ b/sysdeps/unix/sysv/linux/s390/s390-64/syscall_cancel.S > @@ -0,0 +1,62 @@ > +/* Cancellable syscall wrapper. Linux/s390x version. > + Copyright (C) 2023 Free Software Foundation, Inc. > + This file is part of the GNU C Library. > + > + The GNU C Library is free software; you can redistribute it and/or > + modify it under the terms of the GNU Lesser General Public > + License as published by the Free Software Foundation; either > + version 2.1 of the License, or (at your option) any later version. > + > + The GNU C Library is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + Lesser General Public License for more details. > + > + You should have received a copy of the GNU Lesser General Public > + License along with the GNU C Library; if not, see > + . */ > + > +#include > +#include > + > +/* long int __syscall_cancel_arch (int *cancelhandling, > + __syscall_arg_t nr, > + __syscall_arg_t arg1, > + __syscall_arg_t arg2, > + __syscall_arg_t arg3, > + __syscall_arg_t arg4, > + __syscall_arg_t arg5, > + __syscall_arg_t arg6) */ > + > +ENTRY (__syscall_cancel_arch) > + stmg %r6,%r7,48(%r15) > + cfi_offset (%r6, -112) > + cfi_offset (%r7, -104) > + > + .globl __syscall_cancel_arch_start > +__syscall_cancel_arch_start: > + /* if (*cancelhandling & CANCELED_BITMASK) > + __syscall_do_cancel() */ > + tm 3(%r2),TCB_CANCELED_BITMASK > + jne 1f > + > + /* Issue a 6 argument syscall, the nr [%r1] being the syscall > + number. */ > + lgr %r1,%r3 > + lgr %r2,%r4 > + lgr %r3,%r5 > + lgr %r4,%r6 > + lmg %r5,%r7,160(%r15) > + svc 0 > + > + .globl __syscall_cancel_arch_end > +__syscall_cancel_arch_end: > + lmg %r6,%r7,48(%r15) > + cfi_remember_state > + cfi_restore (%r7) > + cfi_restore (%r6) > + br %r14 > +1: > + cfi_restore_state > + jg __syscall_do_cancel > +END (__syscall_cancel_arch) Hi Adhemerval, the syscall_cancel.S files looks good. The testsuite also runs fine. Thanks.