[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b9ba6669-205e-023d-2c11-fc962dc32d55@redhat.com>
Date: Thu, 13 Sep 2018 21:53:20 +0200
From: Florian Weimer <fweimer@...hat.com>
To: Andy Lutomirski <luto@...capital.net>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Andy Lutomirski <luto@...nel.org>,
Matt Rickard <matt@...trans.com.au>,
Stephen Boyd <sboyd@...nel.org>,
John Stultz <john.stultz@...aro.org>, X86 ML <x86@...nel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3] x86/vdso: Handle clock_gettime(CLOCK_TAI) in vDSO
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
Powered by blists - more mailing lists