From patchwork Wed Dec 21 16:19:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Kozlov X-Patchwork-Id: 1718357 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=u5vPd6nT; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.a=rsa-sha256 header.s=pfptdkimsnps header.b=a3CpL/45; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.a=rsa-sha256 header.s=mail header.b=mUBtzWnw; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Ncdw15fh5z1ydZ for ; Thu, 22 Dec 2022 03:20:33 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=ZXHwgwun4ukhxGHOGRDM83tWDiN5vGhdDtwjTMFngqA=; b=u5vPd6nTc8aAXr 341NX29wE7ke0+QIQHPPQc5AhZdZuLYzmE++kis1Vgbto8R0Pl+6lM5VBlZwUZ6K6+dI/GPgB07oY QhEvtgBeDfc4VIc+/Hj7aDwKX7fBvFuX4zyPCmD5paPqwseAiya71uuawsSEcg4aaQ6b1sbScLVRS eZLNAKn+n1QkX5IgkbvbDCW3nFAhF32EK/jHZZLgt6syuVWeZuTBcCjaE1D21vK+eP/xBBgx2J13z XfJ9MG3JRYG12jgEAEuMuC1yZYaPVw2LUvymUIMX+YhnfKZOh5p01L/k8kFcXVRrZ84eZ0stbrqx8 vj8xLHb6ethIAbGVPwYg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p81pW-00GzJp-3a; Wed, 21 Dec 2022 16:20:30 +0000 Received: from mx0a-00230701.pphosted.com ([148.163.156.19]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p81pM-00GzFq-Ra for linux-snps-arc@lists.infradead.org; Wed, 21 Dec 2022 16:20:22 +0000 Received: from pps.filterd (m0098571.ppops.net [127.0.0.1]) by mx0a-00230701.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BLGDVuC010350; Wed, 21 Dec 2022 08:20:18 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=pfptdkimsnps; bh=OM6KIBz5Y3WYwlTVp+9CZ6lvBSr8wKgXRS9cqsvd6d8=; b=a3CpL/45vSnyu3mMdvlreSIK0XDgneSNESGDY3jmyP7pSUj0e0dDMIPBJW9ikE3JTkE+ MH/CFHOcFKdyB0UboZyNFL53yR0qzpGQ7nKqORrfnQXBSCETK7GWQLeyb6dEI1MTaI00 c6KGw5qZXlxnh4Rx+6U+MCYe3cOygFLiOmJNa7v4xGkuAX+Dj7Ewm9CLeMC2YNbZb6Bw rbmeNbtfHB1xo7af9JG52SVJ/v8CEqGYVec+po2J+h66YVoMOUYHU+QYpKhNgr1vRw8g Ts4ZD5/BoIRfWQ9ld+8QI4upocKk4TNdiHPIjMS0yKxuby6Jhcb23wEoPaR6VUWCoMJu jg== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.73.133]) by mx0a-00230701.pphosted.com (PPS) with ESMTPS id 3mkvu49hkd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 21 Dec 2022 08:20:17 -0800 Received: from mailhost.synopsys.com (mdc-mailhost1.synopsys.com [10.225.0.209]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mailhost.synopsys.com", Issuer "SNPSica2" (verified OK)) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 1E580400F0; Wed, 21 Dec 2022 16:20:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1671639617; bh=MO27H751XXxjWiA5cBeJ7whNpuPSrPN2EQy5kZtURt8=; h=From:To:Cc:Subject:Date:From; b=mUBtzWnwEimL2pCMwkNdPx44pAjtPypXNbuIn3vYUob+kKc/Kd2EhzUDR5qDWM1Sd HAzQAIBLx7ak4locDmqevPn5X0sXi2N3HT5VINvIDw+IR3iZXHrBQA+S2WPhFX82EV Uzub3xnSWxpvaMk2bt2DCDjABZUHkwQqIFuXyl786K5kkb3YHYXcw3XAdLrn9FV0ME ccZcK0i7VZS1w7d3kU6l39vMEUAEuNQdAhxJa94OMmuXF39OaBvH8dyIONv9AyLyBb /Rn1QiJ480U+NrF1XFK4OSLcjoEUhef6GoGAxJKYH+CC5GhdwPvjAYPpsnwQ4cpF6i xjmijrJ0e4BQQ== Received: from SNPS-o0WHuHJU73.internal.synopsys.com (snps-o0whuhju73.internal.synopsys.com [10.116.111.163]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client did not present a certificate) by mailhost.synopsys.com (Postfix) with ESMTPSA id 298FAA005D; Wed, 21 Dec 2022 16:20:13 +0000 (UTC) X-SNPS-Relay: synopsys.com From: Pavel.Kozlov@synopsys.com To: libc-alpha@sourceware.org Cc: linux-snps-arc@lists.infradead.org, Pavel Kozlov Subject: [PATCH] ARC: align child stack in clone Date: Wed, 21 Dec 2022 20:19:46 +0400 Message-Id: <20221221161946.12090-1-kozlov@synopsys.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: Pg9dTaTxD0yqJ5ezIeuOySkbwBIZwZXe X-Proofpoint-GUID: Pg9dTaTxD0yqJ5ezIeuOySkbwBIZwZXe X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-21_08,2022-12-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_active_cloned_notspam policy=outbound_active_cloned score=0 mlxscore=0 impostorscore=0 suspectscore=0 phishscore=0 malwarescore=0 bulkscore=0 spamscore=0 priorityscore=1501 mlxlogscore=785 adultscore=0 lowpriorityscore=0 clxscore=1011 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212210136 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221221_082021_024414_30BE9533 X-CRM114-Status: GOOD ( 12.83 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Pavel Kozlov The ARCv2 ABI requires 4 byte stack pointer alignment. Don't allow to use unaligned child stack in clone. As the stack grows down, align it down. This was pointed by misc/tst-misalign-clone-internal and misc/tst-misalign-clone tests. Stack alignmet fixes these tests fails. --- sysdeps/unix/sysv/linux/arc/clone.S | 1 + 1 file changed, 1 insertio [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Pavel Kozlov The ARCv2 ABI requires 4 byte stack pointer alignment. Don't allow to use unaligned child stack in clone. As the stack grows down, align it down. This was pointed by misc/tst-misalign-clone-internal and misc/tst-misalign-clone tests. Stack alignmet fixes these tests fails. Reviewed-by: Adhemerval Zanella --- sysdeps/unix/sysv/linux/arc/clone.S | 1 + 1 file changed, 1 insertion(+) diff --git a/sysdeps/unix/sysv/linux/arc/clone.S b/sysdeps/unix/sysv/linux/arc/clone.S index bd924890844a..f32c83f17a65 100644 --- a/sysdeps/unix/sysv/linux/arc/clone.S +++ b/sysdeps/unix/sysv/linux/arc/clone.S @@ -41,6 +41,7 @@ ENTRY (__clone) cmp r0, 0 /* @fn can't be NULL. */ + and r1,r1,-4 /* @child_stack be 4 bytes aligned per ABI. */ cmp.ne r1, 0 /* @child_stack can't be NULL. */ bz L (__sys_err)