Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1142306imm; Thu, 13 Sep 2018 13:25:41 -0700 (PDT) X-Google-Smtp-Source: ANB0VdalDfy7bUe6YLmhjsH3qs+ZPySDi3O4hkLSS40PrRxx4SkSXDPjlB3YqfToFfZoF5PLUVqz X-Received: by 2002:a65:594b:: with SMTP id g11-v6mr8616151pgu.260.1536870341398; Thu, 13 Sep 2018 13:25:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536870341; cv=none; d=google.com; s=arc-20160816; b=C4/WgKIKIrJziFM7gqjjs6wIG9JdsNsQEGOzglOpfaI2QyEv82+o12BGchZcBUUSff sKHA6aNQ4MMxVf1njHex9UlFUlTzai3c1TO3XI7TJ9ckBfaUVjmEAmGi4QF6rYyZffxx TRls/wsvmHBcRd0D0cPA1SPoj68Kuh6aDythyrYnyc3jQWpCQfShPbb/exn3thb+qymg 2e4igo0ePfYKUsZXEiZ+7P+V3TbRcKVUdZQY/is46k+5GxL2SVNjh0VB2DRTqO2YZpjw XMMHGmDHfScW4h6tMX8EDR5suvVq2P99I35YLrdVGlQJktXbLy52fDX6Qlzpn/WPml2H tNCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=F05oLXVdG3Y6dcmw4O2S18qgGsN6Bmk60WoVyqA/6cE=; b=gvqhwJDUrpU9yOMtLB4jKrJjXEjmj+fYBGOXUuTXb50o0fX3Fa6dePJR3tPWSwQFFf PU3inLRfILAsnIsukWYXRFNPDbE4VwOTYo5RFYzHMmHE+ekfOPVPCDu7MTXafbXsz/P/ CQr9xJFvXzbg6FH2vDZygQnSRZ53IEkIjRf+lg1aqnb4UWhIUS5/upkefjpXrJlELv5G FsW2WmRPvBHbGpe0gLWSY3PDrnwCAgdVQsApcAtwyuyHqE0DBsW2mc3fc5Ncq5Au/0v2 GMtgz3TMMyFtRf7GPXsHXZ/my67IlYxTN7o4WgeBMQ1d8Dgs2wYN26RRmPL3dMzqffCn shiA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p13-v6si4947554pgi.317.2018.09.13.13.24.42; Thu, 13 Sep 2018 13:25:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727988AbeINBEW (ORCPT + 99 others); Thu, 13 Sep 2018 21:04:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33874 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727640AbeINBEW (ORCPT ); Thu, 13 Sep 2018 21:04:22 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 816CF30022E6; Thu, 13 Sep 2018 19:53:24 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-116-49.ams2.redhat.com [10.36.116.49]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DC8CF2010CF7; Thu, 13 Sep 2018 19:53:22 +0000 (UTC) Subject: Re: [PATCH v3] x86/vdso: Handle clock_gettime(CLOCK_TAI) in vDSO To: Andy Lutomirski Cc: Thomas Gleixner , Andy Lutomirski , Matt Rickard , Stephen Boyd , John Stultz , X86 ML , LKML References: <20180901015935.CCF0B18E20A9@virtux64.softrans.com.au> <59403142-1073-3926-65dd-ac55ead357b9@redhat.com> <0120ea99-fcac-839a-ef8f-1daa74c17bec@redhat.com> <5f9e890c-fd67-2e39-42ca-64290301b20a@redhat.com> From: Florian Weimer Message-ID: Date: Thu, 13 Sep 2018 21:53:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.25 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Thu, 13 Sep 2018 19:53:24 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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