On 16/05/2018 07:44, Szabolcs Nagy wrote:
The other thing that would be nice to document is that
why this change is safe for gettimeofday but not clock_gettime.
(former does not have to set errno other than EFAULT but that
case never works with vdso anyway, so the gettimeofday vdso
function is a complete implementation, while clock_gettime
has to deal with errno after the vdso call)
As I put previously keep in mind that different that x86 and powerpc
implementations, where the vDSO symbol does not fail; the arm64 vDSO
implements a syscall fallback in case of underlying hardware requires
an out-of-line counter access (arch_timer_enable_workaround).
Using a ifunc accessors to call vDSO directly will result in a slight
different semantic since generic implementation (kernel/time/time.c)
might return EFAULT in some cases (which won't be handled by ifunc
implementation). This should not be an issue since POSIX [1] defines
no error code should reserved for the symbol, but it might trigger
some test in LTP.