This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2 01/16] linux: Fix vDSO macros build with time64 interfaces
- From: Siddhesh Poyarekar <siddhesh at gotplt dot org>
- To: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>, libc-alpha at sourceware dot org
- Date: Thu, 2 Jan 2020 17:37:10 +0530
- Subject: Re: [PATCH v2 01/16] linux: Fix vDSO macros build with time64 interfaces
- References: <20191217214728.2886-1-adhemerval.zanella@linaro.org>
On 18/12/19 3:17 am, Adhemerval Zanella wrote:
> Changes from previous version:
>
> - Reinstate syscall fallback on INLINE_VSYSCALL, it simplifies
> when the macro is used multiple times (as for clock_gettime
> and clock_getres).
>
> --
>
> As indicated on libc-help [1] the ec138c67cb commit broke 32-bit
> builds when configured with --enable-kernel=5.1 or higher. The
> scenario 10 from [2] might also occur in this configuration and
What is scenario 10 from [2]?
> INLINE_VSYSCALL will try to use the vDSO symbol and
> HAVE_CLOCK_GETTIME64_VSYSCALL does not set HAVE_VSYSCALL prior its
> usage.
>
> Also, there is no easy way to just enable the code to use one
> vDSO sysmbo since the macro INLINE_VSYSCALL is redefined if
symbol
> HAVE_VSYSCALL is set.
>
> Instead of adding more pre-processor handling and making the code
> even more convoluted, this patch removes the requirement of defining
> HAVE_VSYSCALL before including sysdep-vdso.h to enable vDSO usage.
>
> The INLINE_VSYSCALL is now expected to be issued inside a
> HAVE_*_VSYSCALL check, since it will try to use the internal vDSO
> pointers.
>
> Both clock_getres and clock_gettime vDSO code for time64_t were
> removed since there is no vDSO setup code for the symbol (an
> architecture can not set HAVE_CLOCK_GETTIME64_VSYSCALL).
>
> Checked on i686-linux-gnu (default and with --enable-kernel=5.1),
> x86_64-linux-gnu, aarch64-linux-gnu, and powerpc64le-linux-gnu.
> I also checked against a build to mips64-linux-gnu and
> sparc64-linux-gnu.
>
> [1] https://sourceware.org/ml/libc-help/2019-12/msg00014.html
> ---
> .../unix/sysv/linux/aarch64/gettimeofday.c | 4 --
> sysdeps/unix/sysv/linux/clock_getres.c | 36 +++++++++++-------
> sysdeps/unix/sysv/linux/clock_gettime.c | 38 +++++++++++--------
> sysdeps/unix/sysv/linux/getcpu.c | 9 +----
> .../unix/sysv/linux/powerpc/gettimeofday.c | 4 --
> sysdeps/unix/sysv/linux/powerpc/time.c | 4 --
> sysdeps/unix/sysv/linux/sched_getcpu.c | 15 +++-----
> sysdeps/unix/sysv/linux/sysdep-vdso.h | 34 +----------------
> sysdeps/unix/sysv/linux/x86/gettimeofday.c | 4 --
> sysdeps/unix/sysv/linux/x86/time.c | 8 ++--
> 10 files changed, 58 insertions(+), 98 deletions(-)
>
The change looks OK with the above nits.
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>