From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: [musl] Adding vdso support for powerpc[64] and s390x
Date: Wed, 21 Aug 2024 12:29:11 -0400 [thread overview]
Message-ID: <20240821162911.GY10433@brightrain.aerifal.cx> (raw)
[-- Attachment #1: Type: text/plain, Size: 741 bytes --]
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
[-- Attachment #2: ppc+s390x-vdso.diff --]
[-- Type: text/plain, Size: 1461 bytes --]
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"
next reply other threads:[~2024-08-21 16:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-21 16:29 Rich Felker [this message]
2024-08-21 20:46 ` Thorsten Glaser
2024-08-22 0:31 ` Rich Felker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240821162911.GY10433@brightrain.aerifal.cx \
--to=dalias@libc.org \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).