From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from xry111.site (xry111.site [IPv6:2001:470:683e::1]) by sourceware.org (Postfix) with ESMTPS id B40453858CDA for ; Mon, 27 Mar 2023 13:32:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B40453858CDA Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=xry111.site Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=xry111.site DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1679923975; bh=qdpNRLWxS2yFaYERRYJnd2QPWm+jn/kAqo5jWaF/lV8=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=fOnPWgEXhNWRwe5oEo4EKVj9CU9CSg3rxI1jCP9xnqjGBXVIHiJxUlSvmpf1MwysE CpjK3uBw3CEmdmwnR6spOKs3wm9rCQfpgmItM4M7L76rBZrfLb6g+2mPEzQZ/MYRBQ gfx/g2UvrcPCz9O3dBblDEtDAvGOc+hgsrDPAQno= Received: from localhost.localdomain (xry111.site [IPv6:2001:470:683e::1]) (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@xry111.site) by xry111.site (Postfix) with ESMTPSA id E616065C44; Mon, 27 Mar 2023 09:32:53 -0400 (EDT) Message-ID: <3463ca06ffc68341583d8cdbc2b2ebde941b89e6.camel@xry111.site> Subject: Re: [PATCH v2 5/5] aarch64: Define __ASSUME_SYSCALL_NAMED_WORKS for Linux From: Xi Ruoyao To: Adhemerval Zanella Netto , libc-alpha@sourceware.org Cc: caiyinyu , Wang Xuerui , Andreas Schwab , Florian Weimer Date: Mon, 27 Mar 2023 21:32:51 +0800 In-Reply-To: <479c6860-7c34-4baf-aec9-8eafb310b879@linaro.org> References: <20230325140815.4170296-1-xry111@xry111.site> <20230325140815.4170296-6-xry111@xry111.site> <479c6860-7c34-4baf-aec9-8eafb310b879@linaro.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.0 MIME-Version: 1.0 X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,LIKELY_SPAM_FROM,SPF_HELO_PASS,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 Mon, 2023-03-27 at 10:06 -0300, Adhemerval Zanella Netto wrote: >=20 >=20 > On 25/03/23 11:08, Xi Ruoyao wrote: > > AAPCS treats the variable arguments same as named ones, and when > > each > > argument is an integer not wider than 8 bytes, the ith argument is > > in > > register xi (0 <=3D i < 8), or the stack slot at (sp + 8 * (i - 8)) > > (i >=3D 8) no matter how many arguments are passed.=C2=A0 So we can def= ine > > __ASSUME_SYSCALL_NAMED_WORKS to avoid unnecessary stack stores in > > the > > syscall wrappers caused by va_start. >=20 > This triggered a build failure on i686 patchwork buildbot [1]. Ouch, misused #if as #ifdef. Will fix and submit v3. >=20 > [1] https://www.delorie.com/trybots/32bit/18431/ >=20 > > --- > > =C2=A0sysdeps/unix/sysv/linux/aarch64/kernel-features.h | 9 +++++++++ > > =C2=A01 file changed, 9 insertions(+) > >=20 > > diff --git a/sysdeps/unix/sysv/linux/aarch64/kernel-features.h > > b/sysdeps/unix/sysv/linux/aarch64/kernel-features.h > > index 3546f6de96..c39ff39da2 100644 > > --- a/sysdeps/unix/sysv/linux/aarch64/kernel-features.h > > +++ b/sysdeps/unix/sysv/linux/aarch64/kernel-features.h > > @@ -21,3 +21,12 @@ > > =C2=A0 > > =C2=A0#undef __ASSUME_CLONE_DEFAULT > > =C2=A0#define __ASSUME_CLONE_BACKWARDS 1 > > + > > +/* Define this if the calling convention for passing x named > > arguments and y > > +=C2=A0=C2=A0 variable arguments is same as passing (x + y) named argum= ents, > > while each > > +=C2=A0=C2=A0 argument is either an integer of which the width is less = than or > > equal to > > +=C2=A0=C2=A0 "long", or a pointer; and an argument can be fetched from= the > > same register > > +=C2=A0=C2=A0 or the same offset from the stack pointer no matter how m= any > > (maybe zero) > > +=C2=A0=C2=A0 arguments are passed after it.=C2=A0 It avoids useless st= ack stores > > caused by > > +=C2=A0=C2=A0 usage of va_start.=C2=A0 */ > > +#define __ASSUME_SYSCALL_NAMED_WORKS=C2=A0=C2=A0=C2=A01 --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University