Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp8197554ybc; Fri, 29 Nov 2019 06:56:21 -0800 (PST) X-Google-Smtp-Source: APXvYqyoKQkpWZRzOgQkafdSlIpP9YNvidU3+d3F8sqKl/C+rhsqjiLZCG9t8+a23+wkNWQcgf+l X-Received: by 2002:a17:906:5786:: with SMTP id k6mr61157717ejq.294.1575039381684; Fri, 29 Nov 2019 06:56:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575039381; cv=none; d=google.com; s=arc-20160816; b=ax7ZTLKLZKhAGQpreRh6p05TGd6mPutDoVnRdyoyTlIwbEsU120D4MrbTprH/ObxwY RaX87Fx4d7xEXobvZOWOpr++xN66dCpsFTc1CTRLtdZQ4Q70xHeQuLReMQGSNKNcOKOc 6ROgUbUHY82YRQiEeCU3TrQSm8+ssk+U7O3IMXuJ4ACHnYiFgCOU63AuNx1NsSpobt8A 7CUze35OcxPgc/fnXzzQtr8i/+ozDk8uzUCq4G53pGsvqcK11IvMRsuW9nRbAie73d6X nvs5NF7kYzkNSZUgOVkWKcuR1KY4Z6zfk23gRh02eZEbIM5qNg4X9NsRhfRqjOj0Wj3b T+sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=o6PLBpFcvA6/3iSigPBPF7OgSgCT09xUz1+oH4ffcqg=; b=rEq2RB1Hosolh8syPuzWJ5Y6oQbCb5pbBGnlTg2x3nqXKXDRPHk3GnlEK7isD/QFhA YPBRrdZ14NWLM2tziIS/f20LpBiwnSITI9aqA4rqVNBTeYeMxnrsTai94FyvnelF0xec LiRwodmniD3d3NbzwuaQ3r6R99v6fz4gH6KoO360/Pg1IzOm5XrSuAmgWmJ3mdp7UmPC rIm1kUKlGws4c+takJA9bCmDtgnWhD+kPceu2vEmACRRF6tv4TJiNOBY9WIe1tiHvpgA nFJl+NCwX+DgpWBXrYSqRkw59tHQuWzfLPZSRMlLGWuTMpJbprcUow1v1nYhyMkJI9il TWSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@goldelico.com header.s=strato-dkim-0002 header.b=RwQSYvu1; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dk20si9245068edb.413.2019.11.29.06.55.57; Fri, 29 Nov 2019 06:56:21 -0800 (PST) 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; dkim=fail header.i=@goldelico.com header.s=strato-dkim-0002 header.b=RwQSYvu1; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727030AbfK2Oww (ORCPT + 99 others); Fri, 29 Nov 2019 09:52:52 -0500 Received: from mo4-p00-ob.smtp.rzone.de ([85.215.255.25]:10655 "EHLO mo4-p00-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727004AbfK2Owv (ORCPT ); Fri, 29 Nov 2019 09:52:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1575039166; s=strato-dkim-0002; d=goldelico.com; h=To:References:Message-Id:Cc:Date:In-Reply-To:From:Subject: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=o6PLBpFcvA6/3iSigPBPF7OgSgCT09xUz1+oH4ffcqg=; b=RwQSYvu1PqyKGVAYUNSKqPUBH5aZa0tIVTKr39557PiQns/sa08/SIvEKfSoH72GGS AEAc9y6w9CnGpWB70qr6je09PuZ+TKRrv6GhBgRc8vEqt4CwlRYAguP39F64+v7hla9a JKMmbcp0EmAo4T0geW3vYoaSamLnDFdJvkmD3bV1m5swlFGtMYBXBK/c0Ntxej3gnvhU AIUM+djn1Nu+obNAWOGA0oA5oRNsOMaHbSEuw9EhKeCB12cQnRYEEve5hy2FpTi9Izx9 1BTRt6B9qIbadk+Ld0ibJ76id8XZcCJondQf298xswDGq7qws7iZM/F3dVrJ/qLns0XP lmew== X-RZG-AUTH: ":JGIXVUS7cutRB/49FwqZ7WcJeFKiMgPgp8VKxflSZ1P34KBj7wpz8NMGH/vgwDeoHw==" X-RZG-CLASS-ID: mo00 Received: from imac.fritz.box by smtp.strato.de (RZmta 45.0.2 DYNA|AUTH) with ESMTPSA id y07703vATEqjTL8 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (curve X9_62_prime256v1 with 256 ECDH bits, eq. 3072 bits RSA)) (Client did not present a certificate); Fri, 29 Nov 2019 15:52:45 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: [PATCH] mips: Fix gettimeofday() in the vdso library From: "H. Nikolaus Schaller" In-Reply-To: <20191129143658.12224-1-vincenzo.frascino@arm.com> Date: Fri, 29 Nov 2019 15:52:45 +0100 Cc: Paul Burton , mips-creator-ci20-dev@googlegroups.com, letux-kernel@openphoenux.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Message-Id: <307717BD-3233-4313-BAA8-7431F4C78773@goldelico.com> References: <20191129143658.12224-1-vincenzo.frascino@arm.com> To: Vincenzo Frascino X-Mailer: Apple Mail (2.3124) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Am 29.11.2019 um 15:36 schrieb Vincenzo Frascino = : >=20 > The libc provides a discovery mechanism for vDSO library and its > symbols. When a symbol is not exposed by the vDSOs the libc falls back > on the system calls. >=20 > With the introduction of the unified vDSO library on mips this = behavior > is not honored anymore by the kernel in the case of gettimeofday(). >=20 > The issue has been noticed and reported due to a dhclient failure on = the > CI20 board: >=20 > root@letux:~# dhclient > ../../../../lib/isc/unix/time.c:200: Operation not permitted > root@letux:~# >=20 > Restore the original behavior fixing gettimeofday() in the vDSO = library. >=20 > Cc: Paul Burton > Reported-by: H. Nikolaus Schaller > Testes-by: H. Nikolaus Schaller # CI20 with JZ4780 ^^^ funny typo... -> Tested-by: > Signed-off-by: Vincenzo Frascino > --- > arch/mips/include/asm/vdso/gettimeofday.h | 13 ------------- > arch/mips/vdso/vgettimeofday.c | 20 ++++++++++++++++++++ > 2 files changed, 20 insertions(+), 13 deletions(-) >=20 > diff --git a/arch/mips/include/asm/vdso/gettimeofday.h = b/arch/mips/include/asm/vdso/gettimeofday.h > index b08825531e9f..0ae9b4cbc153 100644 > --- a/arch/mips/include/asm/vdso/gettimeofday.h > +++ b/arch/mips/include/asm/vdso/gettimeofday.h > @@ -26,8 +26,6 @@ >=20 > #define __VDSO_USE_SYSCALL ULLONG_MAX >=20 > -#ifdef CONFIG_MIPS_CLOCK_VSYSCALL > - > static __always_inline long gettimeofday_fallback( > struct __kernel_old_timeval *_tv, > struct timezone *_tz) > @@ -48,17 +46,6 @@ static __always_inline long gettimeofday_fallback( > return error ? -ret : ret; > } >=20 > -#else > - > -static __always_inline long gettimeofday_fallback( > - struct __kernel_old_timeval *_tv, > - struct timezone *_tz) > -{ > - return -1; > -} > - > -#endif > - > static __always_inline long clock_gettime_fallback( > clockid_t _clkid, > struct __kernel_timespec *_ts) > diff --git a/arch/mips/vdso/vgettimeofday.c = b/arch/mips/vdso/vgettimeofday.c > index 6ebdc37c89fc..6b83b6376a4b 100644 > --- a/arch/mips/vdso/vgettimeofday.c > +++ b/arch/mips/vdso/vgettimeofday.c > @@ -17,12 +17,22 @@ int __vdso_clock_gettime(clockid_t clock, > return __cvdso_clock_gettime32(clock, ts); > } >=20 > +#ifdef CONFIG_MIPS_CLOCK_VSYSCALL > + > +/* > + * This is behind the ifdef so that we don't provide the symbol when = there's no > + * possibility of there being a usable clocksource, because there's = nothing we > + * can do without it. When libc fails the symbol lookup it should = fall back on > + * the standard syscall path. > + */ > int __vdso_gettimeofday(struct __kernel_old_timeval *tv, > struct timezone *tz) > { > return __cvdso_gettimeofday(tv, tz); > } >=20 > +#endif /* CONFIG_MIPS_CLOCK_VSYSCALL */ > + > int __vdso_clock_getres(clockid_t clock_id, > struct old_timespec32 *res) > { > @@ -43,12 +53,22 @@ int __vdso_clock_gettime(clockid_t clock, > return __cvdso_clock_gettime(clock, ts); > } >=20 > +#ifdef CONFIG_MIPS_CLOCK_VSYSCALL > + > +/* > + * This is behind the ifdef so that we don't provide the symbol when = there's no > + * possibility of there being a usable clocksource, because there's = nothing we > + * can do without it. When libc fails the symbol lookup it should = fall back on > + * the standard syscall path. > + */ > int __vdso_gettimeofday(struct __kernel_old_timeval *tv, > struct timezone *tz) > { > return __cvdso_gettimeofday(tv, tz); > } >=20 > +#endif /* CONFIG_MIPS_CLOCK_VSYSCALL */ > + > int __vdso_clock_getres(clockid_t clock_id, > struct __kernel_timespec *res) > { > --=20 > 2.24.0 >=20