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

* Re: [musl] Adding vdso support for powerpc[64] and s390x
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Thorsten Glaser @ 2024-08-21 20:46 UTC (permalink / raw)
  To: musl

Rich Felker dixit:

>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

As a Debian Developer and with accounts on the GCC compile farm,
I can likely test that, ideally if you already have a testsuite
I could run. I cannot however install things into system locations
or do my own chroots on those, so it would have to have run out of
the build tree.

bye,
//mirabilos
-- 
„Cool, /usr/share/doc/mksh/examples/uhr.gz ist ja ein Grund,
mksh auf jedem System zu installieren.“
	-- XTaran auf der OpenRheinRuhr, ganz begeistert
(EN: “[…]uhr.gz is a reason to install mksh on every system.”)

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

* Re: [musl] Adding vdso support for powerpc[64] and s390x
  2024-08-21 20:46 ` Thorsten Glaser
@ 2024-08-22  0:31   ` Rich Felker
  0 siblings, 0 replies; 3+ messages in thread
From: Rich Felker @ 2024-08-22  0:31 UTC (permalink / raw)
  To: Thorsten Glaser; +Cc: musl

On Wed, Aug 21, 2024 at 08:46:40PM +0000, Thorsten Glaser wrote:
> Rich Felker dixit:
> 
> >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
> 
> As a Debian Developer and with accounts on the GCC compile farm,
> I can likely test that, ideally if you already have a testsuite
> I could run. I cannot however install things into system locations
> or do my own chroots on those, so it would have to have run out of
> the build tree.

No need to install anything; this is musl and you can just static
link, or if you really wanted to use dynamic linking, invoke ldso as a
command to run the binary.

Rich

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