From patchwork Tue Jun 8 13:37:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Liebler X-Patchwork-Id: 1489445 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=eNQ9AIJr; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Fzrv63dVLz9s5R for ; Tue, 8 Jun 2021 23:39:30 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D7490383D011 for ; Tue, 8 Jun 2021 13:39:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D7490383D011 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623159567; bh=NX/QzqWE8X/W3zmW0bDBVzFTCNvspCfx4NKJJFhlJao=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=eNQ9AIJrNQTZ5SzOMjPJ+UHRH1yiCe5jm5lyxG4PzyLOujfYQAqh14SS2qMyiimxl Dpv/P+1IMoAFyTYDcllHzAxdESHvnpdhtASB7JdoPpB6hNQADN2qWrMd+nbluqFC2r 3Fux9JaAkzHk3OGCEIyS+MhHp+DqX3xcYqCgN3Ps= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 974BD39551D7 for ; Tue, 8 Jun 2021 13:37:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 974BD39551D7 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 158Da9UV017166 for ; Tue, 8 Jun 2021 09:37:39 -0400 Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0b-001b2d01.pphosted.com with ESMTP id 39251dgaxr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 08 Jun 2021 09:37:39 -0400 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 158DbCZ2009433 for ; Tue, 8 Jun 2021 13:37:37 GMT Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by ppma03ams.nl.ibm.com with ESMTP id 3900w8hja7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 08 Jun 2021 13:37:37 +0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 158DbYma24772886 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Jun 2021 13:37:34 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 49CB952050; Tue, 8 Jun 2021 13:37:34 +0000 (GMT) Received: from t35lp56.lnxne.boe (unknown [9.152.108.100]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 26B215204F; Tue, 8 Jun 2021 13:37:34 +0000 (GMT) To: libc-alpha@sourceware.org Subject: [PATCH] s390x: Align child stack while clone. [BZ #27968] Date: Tue, 8 Jun 2021 15:37:32 +0200 Message-Id: <20210608133732.2553859-1-stli@linux.ibm.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: pfl8X7qpqzBanKyPXRLMbj5br440QZyS X-Proofpoint-GUID: pfl8X7qpqzBanKyPXRLMbj5br440QZyS X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.761 definitions=2021-06-08_09:2021-06-04, 2021-06-08 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 phishscore=0 lowpriorityscore=0 mlxlogscore=628 mlxscore=0 suspectscore=0 spamscore=0 priorityscore=1501 bulkscore=0 malwarescore=0 clxscore=1011 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106080088 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Stefan Liebler via Libc-alpha From: Stefan Liebler Reply-To: Stefan Liebler Cc: Stefan Liebler Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" Starting with recent commit 92a7d1343991897f77afe01041f3b77712445e47 "x86-64: Align child stack to 16 bytes [BZ #27902]" the new test misc/tst-misalign-clone has failed on s390x/s390. This patch is now aligning the stack to a double word boundary as also done in start.S files. --- sysdeps/unix/sysv/linux/s390/s390-32/clone.S | 8 +++++--- sysdeps/unix/sysv/linux/s390/s390-64/clone.S | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/clone.S b/sysdeps/unix/sysv/linux/s390/s390-32/clone.S index bb968db40b..08145e4156 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/clone.S +++ b/sysdeps/unix/sysv/linux/s390/s390-32/clone.S @@ -33,11 +33,13 @@ ENTRY(__clone) st %r6,24(%r15) /* store %r6 to save area */ cfi_offset (%r6, -72) - lr %r0,%r5 /* move *arg out of the way */ ltr %r1,%r2 /* check fn and move to %r1 */ jz error /* no NULL function pointers */ - ltr %r2,%r3 /* check child_stack and move to %r2 */ - jz error /* no NULL stack pointers */ + lhi %r0,-8 /* Align the child_stack to a ... */ + nr %r3,%r0 /* double word boundary and ... */ + jz error /* avoid NULL stack pointers. */ + lr %r0,%r5 /* move *arg out of the way */ + lr %r2,%r3 /* move child_stack to %r2 */ lr %r3,%r4 /* move flags to %r3 */ lr %r4,%r6 /* move parent_tid to %r4 */ l %r5,100(%r15) /* load child_tid from stack */ diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/clone.S b/sysdeps/unix/sysv/linux/s390/s390-64/clone.S index 9eafff7561..21d485e9e9 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/clone.S +++ b/sysdeps/unix/sysv/linux/s390/s390-64/clone.S @@ -34,11 +34,13 @@ ENTRY(__clone) stg %r6,48(%r15) /* store %r6 to save area */ cfi_offset (%r6,-112) - lgr %r0,%r5 /* move *arg out of the way */ ltgr %r1,%r2 /* check fn and move to %r1 */ jz error /* no NULL function pointers */ - ltgr %r2,%r3 /* check child_stack and move to %r2 */ - jz error /* no NULL stack pointers */ + lghi %r0,-16 /* Align the child_stack to a ... */ + ngr %r3,%r0 /* double word boundary and ... */ + jz error /* avoid NULL stack pointers. */ + lgr %r0,%r5 /* move *arg out of the way */ + lgr %r2,%r3 /* move child_stack to %r2 */ lgr %r3,%r4 /* move flags to %r3 */ lgr %r4,%r6 /* move parent_tid to %r4 */ lg %r5,168(%r15) /* load child_tid from stack */