This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v3 7/7] y2038: linux: Provide ___gettimeofday64 implementation
- From: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- To: Lukasz Majewski <lukma at denx dot de>
- Cc: Joseph Myers <joseph at codesourcery dot com>, Paul Eggert <eggert at cs dot ucla dot edu>, Alistair Francis <alistair23 at gmail dot com>, Alistair Francis <alistair dot francis at wdc dot com>, GNU C Library <libc-alpha at sourceware dot org>, Siddhesh Poyarekar <siddhesh at gotplt dot org>, Florian Weimer <fweimer at redhat dot com>, Florian Weimer <fw at deneb dot enyo dot de>, Zack Weinberg <zackw at panix dot com>, Carlos O'Donell <carlos at redhat dot com>, Andreas Schwab <schwab at suse dot de>
- Date: Fri, 7 Feb 2020 10:20:26 -0300
- Subject: Re: [PATCH v3 7/7] y2038: linux: Provide ___gettimeofday64 implementation
- References: <20200129125914.11221-1-lukma@denx.de> <20200129125914.11221-7-lukma@denx.de> <1bfd0cce-e889-7fce-fe7b-d565ca1a1806@linaro.org> <20200205010552.6f0bac91@jawa> <02c823c7-bda4-191a-7825-4727184ae2d7@linaro.org> <20200205175837.1e80e17e@jawa> <ea8f9f38-5d86-e753-ce29-9c9e7cf2e662@linaro.org> <20200206110831.769bc697@jawa>
On 06/02/2020 07:08, Lukasz Majewski wrote:
>>>> I would say to just not define USE_IFUNC_GETTIMEOFDAY for i686 and
>>>> powerpc32 and make them follow the expected code path for y2038
>>>> safeness.
>>>
>>> Shall this be added to this patch? Or shall I left the
>>> USE_IFUNC_GETTIMEOFDAY untouched?
>>
>> Since this patch aims to add time64 gettimeofday for all supported
>> Linux ABI, I think it should be along this patch.
>
> So the proposed solution here is to remove
>
> #define USE_IFUNC_GETTIMEOFDAY
>
> from
>
> sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
> sysdeps/unix/sysv/linux/x86/gettimeofday.c
Only if the ABI have legacy 32 bits time support. More specifically,
for x86 implementation:
#ifdef __x86_64__
# define USE_IFUNC_GETTIMEOFDAY
#endif
And for powerpc:
#ifdef __powerpc64__
# define USE_IFUNC_GETTIMEOFDAY
#endif
>
> ?
>
> I do guess that it would be acceptable to trade some minimal extra
> overhead for gettimeofday serving on those archs for glibc simplicity
> and Y2038 safeness?
My point is the vDSO ifunc optimization on a y2038 safe kernel does not
really matter, since there won't be a 64-bit time gettimeofday implementation
and all architectures will need to call clock_gettime64 (either by syscall or
vDSO) anyway.