lkml.org 
[lkml]   [2018]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v3] x86/vdso: Handle clock_gettime(CLOCK_TAI) in vDSO
From
Date
On 09/13/2018 09:35 PM, Andy Lutomirski wrote:

>> Somewhat special, yes, but not overly so, and not in the type-polymorphic sense. We can't give direct access of the vDSO implementation to applications because the kernel does not know about the userspace errno variable. We do that for time on x86_64, where applications call into the vDSO directly, bypassing glibc completely after binding.
>
> If the vDSO adds special helpers for CLOCK_MONOTONIC and CLOCK_REALTIME, I think we can reasonably safely promise that they never fail. (seccomp can obviously break that promise if there’s no TSC, but I think that seccomp users who do that get to keep both pieces.)

I agree, I thought about the same thing. We already do not return
EFAULT for invalid pointers, for obvious reasons. And if the clock ID
is fixed, the EINVAL error is impossible.

That would shave off a few nanoseconds more if the calling convention is
identical to what glibc exposes to applications. If the vDSO is not
available or the symbol is missing, we can provide an implementation
based on the current clock_gettime in glibc.

Thanks,
Florian

\
 
 \ /
  Last update: 2018-09-13 21:55    [W:0.052 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site