From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from second.openwall.net (second.openwall.net [193.110.157.125]) by inbox.vuxu.org (Postfix) with SMTP id 014872BF30 for ; Wed, 21 Aug 2024 18:29:26 +0200 (CEST) Received: (qmail 28637 invoked by uid 550); 21 Aug 2024 16:29:20 -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 28592 invoked from network); 21 Aug 2024 16:29:20 -0000 Date: Wed, 21 Aug 2024 12:29:11 -0400 From: Rich Felker To: musl@lists.openwall.com Message-ID: <20240821162911.GY10433@brightrain.aerifal.cx> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ZYOWEO2dMm2Af3e3" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Subject: [musl] Adding vdso support for powerpc[64] and s390x --ZYOWEO2dMm2Af3e3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline It was brought to my attention that we're missing vdso clock_gettime support for some archs. Based on the vdso(7) man page and a check of what archs already have support in musl, powerpc, powerpc64, and s390x seem to be the only ones that need to be added. For powerpc64, I'm not clear on if there are any calling convention issues (ELFv2 vs v1) that might make it not work; the other two I would expect to work, but I don't have setups to test them, so I'd appreciate feedback from anyone who can test and who'd like to get these patches in on whether they work. (Theoretically x32 might also should have vdso support, but I'm not sure what the kernel maps in x32 processes and whether the code there is usable from an x32 process.) Rich --ZYOWEO2dMm2Af3e3 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="ppc+s390x-vdso.diff" diff --git a/arch/powerpc/syscall_arch.h b/arch/powerpc/syscall_arch.h index ede97c1c..54c885cb 100644 --- a/arch/powerpc/syscall_arch.h +++ b/arch/powerpc/syscall_arch.h @@ -92,3 +92,9 @@ static inline long __syscall6(long n, long a, long b, long c, long d, long e, lo #define SO_RCVTIMEO_OLD 18 #define SO_SNDTIMEO_OLD 19 + +#define VDSO_USEFUL +#define VDSO_CGT32_SYM "__kernel_clock_gettime" +#define VDSO_CGT32_VER "LINUX_2.6.15" +#define VDSO_CGT_SYM "__kernel_clock_gettime64" +#define VDSO_CGT_VER "LINUX_5.11" diff --git a/arch/powerpc64/syscall_arch.h b/arch/powerpc64/syscall_arch.h index 76b4e335..7d34fbe4 100644 --- a/arch/powerpc64/syscall_arch.h +++ b/arch/powerpc64/syscall_arch.h @@ -88,3 +88,7 @@ static inline long __syscall6(long n, long a, long b, long c, long d, long e, lo #define SO_RCVTIMEO_OLD 18 #define SO_SNDTIMEO_OLD 19 + +#define VDSO_USEFUL +#define VDSO_CGT_SYM "__kernel_clock_gettime" +#define VDSO_CGT_VER "LINUX_2.6.15" diff --git a/arch/s390x/syscall_arch.h b/arch/s390x/syscall_arch.h index 83cc9a27..d1cfd2e8 100644 --- a/arch/s390x/syscall_arch.h +++ b/arch/s390x/syscall_arch.h @@ -72,3 +72,7 @@ static inline long __syscall6(long n, long a, long b, long c, long d, long e, lo register long r7 __asm__("r7") = f; __asm_syscall("+r"(r2), "r"(r1), "r"(r3), "r"(r4), "r"(r5), "r"(r6), "r"(r7)); } + +#define VDSO_USEFUL +#define VDSO_CGT_SYM "__kernel_clock_gettime" +#define VDSO_CGT_VER "LINUX_2.6.29" --ZYOWEO2dMm2Af3e3--