[PATCH 0/2] m68k: Add vDSO support for TLS and clock_gettime64
This series adds vDSO support for m68k, enabling userspace to access
the thread pointer and clock_gettime64 without syscall overhead.
The m68k vDSO provides a data page mapped at a fixed offset from the
ELF header (passed via AT_SYSINFO_EHDR). The kernel maintains the
thread pointer and timing data in this page, updating them on context
switches.
Patch 1 optimizes __m68k_read_tp() to read the thread pointer directly
from the vDSO data page instead of using the get_thread_area syscall.
This significantly reduces overhead for TLS access, which is a frequent
operation in threaded applications.
Patch 2 enables the vDSO clock_gettime64 by defining
HAVE_CLOCK_GETTIME64_VSYSCALL along with the necessary VDSO_NAME and
VDSO_HASH for symbol lookup. This allows glibc to use the
kernel-provided __vdso_clock_gettime64 for fast time retrieval.
Both changes include fallback paths for older kernels that lack vDSO
support.
Performance Results (QEMU Quadra 800)
-------------------------------------
Before (syscall): ~2057 ns/call
After (vDSO): ~675 ns/call
Improvement: ~3x faster
Tested on qemu-system-m68k with Linux 6.18 (Debian/m68k).
Stefan Reinauer (2):
m68k: Use vDSO for thread pointer access
m68k: Enable vDSO clock_gettime64
sysdeps/unix/sysv/linux/m68k/m68k-helpers.c | 77 ++++++++++++++++++++-
sysdeps/unix/sysv/linux/m68k/sysdep.h | 7 ++
2 files changed, 83 insertions(+), 1 deletion(-)
--
2.51.0
Reply to: