From patchwork Fri Aug 13 12:04:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xi Ruoyao X-Patchwork-Id: 44660 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9E1B5388E83D for ; Fri, 13 Aug 2021 12:04:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9E1B5388E83D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1628856295; bh=6hiY96HEsU9z2k3CS/iSy3aH7tLVLN3UvehnTf/u2HY=; h=Subject:To:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=DGeW0x8m7WTRLWjtiLyMo9kgBnUtxRU7z7EXXWpcFmK5+czT3vgQswksv7zrqiDMK nS2f/baCZKk8W4BvN6evZcqiw+B2+yFcj+WaTOEDl7yaLatW/OTnsOHi6yZnFOAOGw yAthFrGrqNpxGiKpC6+D1ncRD1mquz6ZoaExhI90= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mengyan1223.wang (mengyan1223.wang [89.208.246.23]) by sourceware.org (Postfix) with ESMTPS id C0635385AC20 for ; Fri, 13 Aug 2021 12:04:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C0635385AC20 Received: from [IPv6:240e:35a:10bb:ac00:dc73:854d:832e:2] (unknown [IPv6:240e:35a:10bb:ac00:dc73:854d:832e:2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@mengyan1223.wang) by mengyan1223.wang (Postfix) with ESMTPSA id B2D6065CA4; Fri, 13 Aug 2021 08:04:18 -0400 (EDT) Message-ID: Subject: [PATCH v2] mips: increase stack alignment in clone to match the ABI To: Joseph Myers Date: Fri, 13 Aug 2021 20:04:09 +0800 In-Reply-To: References: <07cf2ef7f47070979089f880d91a0369c4efa978.camel@mengyan1223.wang> <97d59c143b34c620f5883670a21ae6286414fff6.camel@mengyan1223.wang> User-Agent: Evolution 3.40.3 MIME-Version: 1.0 X-Spam-Status: No, score=-3039.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, JMQ_SPF_NEUTRAL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Xi Ruoyao via Libc-alpha From: Xi Ruoyao Reply-To: Xi Ruoyao Cc: libc-alpha@sourceware.org Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" v2: change the comment along with the code I must have been too sleepy in recent two days... --- In "mips: align stack in clone [BZ #28223]" (commit 1f51cd9a860ee45eee8a56fb2ba925267a2a7bfe) I made a mistake: I misbelieved one "word" was 2-byte and "doubleword" should be 4-byte. But in MIPS ABI one "word" is defined 32-bit (4-byte), so "doubleword" is 8-byte [1], and "quadword" is 16-byte [2]. [1]: "System V Application Binary Interface: MIPS(R) RISC Processor Supplement, 3rd edition", page 3-31 [2]: "MIPSpro(TM) 64-Bit Porting and Transition Guide", page 23 --- sysdeps/unix/sysv/linux/mips/clone.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sysdeps/unix/sysv/linux/mips/clone.S b/sysdeps/unix/sysv/linux/mips/clone.S index 43a5ad3a40..fd71b5ca2e 100644 --- a/sysdeps/unix/sysv/linux/mips/clone.S +++ b/sysdeps/unix/sysv/linux/mips/clone.S @@ -55,11 +55,11 @@ NESTED(__clone,4*SZREG,sp) .set at #endif - /* Align stack to 4/8 bytes per the ABI. */ + /* Align stack to 8/16 bytes per the ABI. */ #if _MIPS_SIM == _ABIO32 - li t0,-4 -#else li t0,-8 +#else + li t0,-16 #endif and a1,a1,t0