From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.2 Received: (qmail 16798 invoked from network); 25 Apr 2020 05:40:38 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with UTF8ESMTPZ; 25 Apr 2020 05:40:38 -0000 Received: (qmail 9914 invoked by uid 550); 25 Apr 2020 05:40:32 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 9893 invoked from network); 25 Apr 2020 05:40:31 -0000 Date: Sat, 25 Apr 2020 01:40:19 -0400 From: Rich Felker To: Nicholas Piggin Cc: linuxppc-dev@lists.ozlabs.org, binutils@sourceware.org, libc-alpha@sourceware.org, libc-dev@lists.llvm.org, musl@lists.openwall.com, Adhemerval Zanella Message-ID: <20200425054019.GI11469@brightrain.aerifal.cx> References: <1587790194.w180xsw5be.astroid@bobo.none> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1587790194.w180xsw5be.astroid@bobo.none> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] New powerpc vdso calling convention On Sat, Apr 25, 2020 at 03:22:27PM +1000, Nicholas Piggin wrote: > As noted in the 'scv' thread, powerpc's vdso calling convention does not > match the C ELF ABI calling convention (or the proposed scv convention). > I think we could implement a new ABI by basically duplicating function > entry points with different names. > > The ELF v2 ABI convention would suit it well, because the caller already > requires the function address for ctr, so having it in r12 will > eliminate the need for address calculation, which suits the vdso data > page access. > > Is there a need for ELF v1 specific calls as well, or could those just be > deprecated and remain on existing functions or required to use the ELF > v2 calls using asm wrappers? musl doesn't use ELFv1, but my expectation would be for the kernel to provide an ELFv1 VDSO to an ELFv1 process. (I'm pretty sure the kernel has to be aware of this property of the process-image (executable file) since it affects how signals work.) > Is there a good reason for the system call fallback to go in the vdso > function rather than have the caller handle it? Originally it was deemed the vdso's responsibility to do fallback, but MIPS broke this contract so musl always makes a syscall itself if the vdso function returns -ENOSYS. I believe it honors other errors. We could change it to fallback on all errors if needed. I'm not sure what glibc does here. Rich