From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from albireo.enyo.de (albireo.enyo.de [37.24.231.21]) by sourceware.org (Postfix) with ESMTPS id 931303858CDA for ; Fri, 24 Mar 2023 10:45:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 931303858CDA Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=deneb.enyo.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=deneb.enyo.de Received: from [172.17.203.2] (port=43409 helo=deneb.enyo.de) by albireo.enyo.de ([172.17.140.2]) with esmtps (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) id 1pfevf-00EzPR-Iv; Fri, 24 Mar 2023 10:45:51 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.96) (envelope-from ) id 1pfevf-0012zt-1J; Fri, 24 Mar 2023 11:45:51 +0100 From: Florian Weimer To: Xi Ruoyao Cc: Xi Ruoyao via Libc-alpha , caiyinyu , Wang Xuerui , Adhemerval Zanella Netto , Andreas Schwab Subject: Re: [PATCH] linux: Allow avoiding va_list for generic syscall and use it for LoongArch References: <20230324072745.4138-1-xry111@xry111.site> <87mt424h0y.fsf@mid.deneb.enyo.de> <30790befdca73a5224b5a9a4491821e33cccc771.camel@xry111.site> Date: Fri, 24 Mar 2023 11:45:51 +0100 In-Reply-To: <30790befdca73a5224b5a9a4491821e33cccc771.camel@xry111.site> (Xi Ruoyao's message of "Fri, 24 Mar 2023 18:36:32 +0800") Message-ID: <87mt422zs0.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,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: * Xi Ruoyao: > On Fri, 2023-03-24 at 10:47 +0100, Florian Weimer wrote: >> * Xi Ruoyao via Libc-alpha: >>=20 >> > Currently GCC generates highly sub-optimal code on architectures >> > where >> > the calling convention prefers registers for arugment passing.=A0 This >> > is >>=20 >> Typo: ar[gu]ment >>=20 >> > LoongArch is benefited from this (saving about 430 CPU cycles per >> > syscall, though I won't call it a significant improvement because >> > syscall is "slow" in nature).=A0 And in the future we may switch more >> > ports to use the generic syscall without a performance regression, >> > reducing the number of target-specific syscall.{c,S} files we need >> > to >> > maintain. >>=20 >> Does this impact the open* and fcntl* wrappers as well? > > Yes, on LoongArch all GARs are saved :(. I'll see if it's possible to > avoid using va_list for them too. If we had overread the argument list in open*, that certainly would have avoided all the grief we had with O_TMPFILE (where the original glibc implementation did not pass the mode argument to the kernel). I think fcntl* already overreads the argument list, so it should be safe.