mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] Adding vdso support for powerpc[64] and s390x
@ 2024-08-21 16:29 Rich Felker
  2024-08-21 20:46 ` Thorsten Glaser
  0 siblings, 1 reply; 3+ messages in thread
From: Rich Felker @ 2024-08-21 16:29 UTC (permalink / raw)
  To: musl

[-- 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"

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-08-22  0:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-21 16:29 [musl] Adding vdso support for powerpc[64] and s390x Rich Felker
2024-08-21 20:46 ` Thorsten Glaser
2024-08-22  0:31   ` Rich Felker

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).