This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH 0/4] vDSO cleanup
- From: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- To: libc-alpha at sourceware dot org
- Date: Wed, 15 Apr 2015 17:21:38 -0300
- Subject: [PATCH 0/4] vDSO cleanup
- Authentication-results: sourceware.org; auth=none
Hi all,
Motivate by the recent ARM32 vDSO RFC patch [1], which raise some question
about current vDSO implementation across arches and the possibility of a
refactor; I am proposing this patch to simplify current implementation
and make it easier to add further vDSO symbols.
The patchset is divided in four parts:
1. Define INLINE_VSYSCALL on all ports: add the INLINE_VSYSCALL definition
to each arch that does not already define it with exception of i386.
For i386 a more thoughtfully cleanup is done in third patch.
2. Consolidate gettimeofday across aarch64/s390/tile: this simplify current
implementation for this arch by eliminating shard code.
3. libc-vdso.h place consolidation: This places the libc-vdso.h outside bits
folder, aligning all arches with recent (2.21) x86 cleanup.
4. x86: clock_gettime and timespec_get vDSO cleanup: simplify the x86
implementation by using the HAVE_CLOCK_GETTIME_VSYSCALL used by other
arches.
I have tested this patchset on the machines I have access: i686, x86_64,
arm-gnu-eabi, arm-gnu-eabihf, aarch64, and powerpc64le. These cover pretty
much all the build possibilities for the other touched arches, but a
confirmation from ports maintainers would be good.
Other cleanups that I am checking are:
1. Consolidade the getcpu/sched_getcpu over the architecture, by eliminating
x86 assembly implementation and the shared implementation for tile and
powerpc.
2. Add the iFUNC configurable mechanism on linux gettimeofday to make it
able to replace the x86 and powerpc implementation. The idea is to make
configurable HAVE_GETTIME_IFUNC or something and enable it conditionally.
3. Check if it feasible to refactor current vdso symbol creation and
INLINE_VSYSCALL in a single unit. The idea is to use macros to declare
the vDSO which will be used the port (for instance, DECLARE_VDSO(gettimeofday))
and then make INLINE_VSYSCALL generic, since it just check if the pointer
is non-null, demangle it and call it.
--
ChangeLog | 64 +++++++++++++++++++
nptl/pthread_cond_timedwait.c | 2 +-
sysdeps/powerpc/powerpc32/backtrace.c | 2 +-
sysdeps/powerpc/powerpc64/backtrace.c | 2 +-
sysdeps/unix/sysv/linux/aarch64/bits/libc-vdso.h | 31 ---------
sysdeps/unix/sysv/linux/aarch64/gettimeofday.c | 38 -----------
sysdeps/unix/sysv/linux/aarch64/init-first.c | 2 +-
sysdeps/unix/sysv/linux/aarch64/libc-vdso.h | 31 +++++++++
sysdeps/unix/sysv/linux/aarch64/sysdep.h | 1 +
sysdeps/unix/sysv/linux/alpha/sysdep.h | 4 ++
sysdeps/unix/sysv/linux/arm/sysdep.h | 4 ++
sysdeps/unix/sysv/linux/clock_getres.c | 2 +-
sysdeps/unix/sysv/linux/clock_gettime.c | 2 +-
sysdeps/unix/sysv/linux/gettimeofday.c | 35 +++++++++++
sysdeps/unix/sysv/linux/hppa/sysdep.h | 4 ++
sysdeps/unix/sysv/linux/i386/sysdep.h | 2 +
sysdeps/unix/sysv/linux/ia64/sysdep.h | 4 ++
sysdeps/unix/sysv/linux/m68k/sysdep.h | 4 ++
sysdeps/unix/sysv/linux/mips/mips32/sysdep.h | 4 ++
sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h | 4 ++
sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h | 4 ++
sysdeps/unix/sysv/linux/nios2/sysdep.h | 4 ++
sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h | 76 ----------------------
sysdeps/unix/sysv/linux/powerpc/get_clockfreq.c | 2 +-
sysdeps/unix/sysv/linux/powerpc/gettimeofday.c | 2 +-
sysdeps/unix/sysv/linux/powerpc/init-first.c | 2 +-
sysdeps/unix/sysv/linux/powerpc/libc-vdso.h | 76 ++++++++++++++++++++++
sysdeps/unix/sysv/linux/powerpc/sched_getcpu.c | 2 +-
sysdeps/unix/sysv/linux/powerpc/time.c | 2 +-
sysdeps/unix/sysv/linux/s390/bits/libc-vdso.h | 34 ----------
sysdeps/unix/sysv/linux/s390/gettimeofday.c | 39 ------------
sysdeps/unix/sysv/linux/s390/init-first.c | 2 +-
sysdeps/unix/sysv/linux/s390/libc-vdso.h | 34 ++++++++++
sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h | 1 +
sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h | 1 +
sysdeps/unix/sysv/linux/sh/sysdep.h | 4 ++
sysdeps/unix/sysv/linux/sparc/sysdep.h | 4 ++
sysdeps/unix/sysv/linux/tile/bits/libc-vdso.h | 40 ------------
sysdeps/unix/sysv/linux/tile/gettimeofday.c | 32 ----------
sysdeps/unix/sysv/linux/tile/libc-vdso.h | 40 ++++++++++++
sysdeps/unix/sysv/linux/tile/sysdep.h | 1 +
sysdeps/unix/sysv/linux/timespec_get.c | 3 +-
sysdeps/unix/sysv/linux/x86/clock_gettime.c | 34 ----------
sysdeps/unix/sysv/linux/x86/sysdep.h | 80 ++++++++++++++++++++++++
sysdeps/unix/sysv/linux/x86/timespec_get.c | 29 ---------
sysdeps/unix/sysv/linux/x86_64/sysdep.h | 56 +----------------
46 files changed, 426 insertions(+), 420 deletions(-)