From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 212E21F463 for ; Tue, 7 Jan 2020 14:25:43 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type; q=dns; s=default; b=j8xf8 H/3eRD9UTVI6X+hwStR0SVc6b7Fa7jTMPQ2x+bKppAHpAK7BFiSGPGmvFN1MTCvs m06ZmeBDS4sVcThqjb3AngCwzLSR17zPiq1NtJ61HCZIeVUiWOnuHskhgrcyIoa6 VG3M9EoeLx2fsn2Ayu2nCOuCZtLCMy3y3pFJDQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type; s=default; bh=Y3IdoFcBvvH di5E2e6iYPKCNUlo=; b=ug0CqJaGrpQC5n94H/pEEcmMfTczna0u6TtoiECbr26 bV48VTDi5CO1YjaWv6a/b4ySFmTiUPTgTHy7i2hgleJkUnFlnlYZzRrv5XA5AOEj 4fWqS+CkoYLUnk64TUyQUfOLRQmLQeNNrskEE7Lz1ryr0Owo5uQbA2xuAWewezPw = Received: (qmail 14778 invoked by alias); 7 Jan 2020 14:25:40 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 14762 invoked by uid 89); 7 Jan 2020 14:25:40 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: mail-out.m-online.net Date: Tue, 7 Jan 2020 15:25:21 +0100 From: Lukasz Majewski To: Adhemerval Zanella Cc: Joseph Myers , Paul Eggert , Andreas Schwab , Alistair Francis , Alistair Francis , GNU C Library , Siddhesh Poyarekar , Florian Weimer , Florian Weimer , Zack Weinberg , Carlos O'Donell , Arnd Bergmann Subject: Re: [PATCH v4 1/2] y2038: linux: Provide __timerfd_gettime64 implementation Message-ID: <20200107152521.7416d5f3@jawa> In-Reply-To: References: <20200106121742.1628-1-lukma@denx.de> <20200107102752.396f7f6f@jawa> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/cDEJ5ezM23p=kSUs3fzqhAC"; protocol="application/pgp-signature" --Sig_/cDEJ5ezM23p=kSUs3fzqhAC Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi Adhemerval, > On 07/01/2020 06:27, Lukasz Majewski wrote: >=20 > >> As a side note, now that arch-syscall patch is upstream should we > >> assume that for !__ASSUME_TIME64_SYSCALLS the > >> __NR_timerfd_gettime64 should be defined (meaning that Linux > >> supports time64 for all 32-bit architectures)? =20 > >=20 > > Only Linux version >=3D 5.1 supports 64 bit time on archs with > > __WORDSIZE =3D 32. I do guess (but I may be wrong here) that the > > arch-syscall is supposed to reflect the exact syscalls provided by > > kernel headers used for building (to help with validation of Y2038 > > patches). =20 >=20 > The arch-syscall is now autogenerated from the latest kernel release > defined in build-many-glibcs.py. So the question is whether Linux > support and enforces time64 support on all and future 32-bit=20 > architectures or if there is still some missing ones (as it has > happen on some syscall additions, where some architecture lag > behind some releases). This question would be best answered by Arnd (CC'ed) IMHO. From what I know all 32 bit architectures gained syscalls covered by __ASSUME_TIME64_SYSCALLS from Linux 5.1+. The arch-syscall seems to me like a mean to test for example the time related syscalls which use different versions (32bit time vs 64 bit) on different archs. Notable example - clock_gettime(). Am I right? >=20 >=20 > > =20 > >> =20 > >>> + struct itimerspec its32; > >>> + int retval =3D INLINE_SYSCALL_CALL (timerfd_gettime, fd, &its32); > >>> + if (retval =3D=3D 0) > >>> + { > >>> + value->it_interval =3D valid_timespec_to_timespec64 > >>> (its32.it_interval); > >>> + value->it_value =3D valid_timespec_to_timespec64 > >>> (its32.it_value); > >>> + } > >>> + > >>> + return retval; > >>> +#endif > >>> +} =20 > >> > >> > >> Ok. > >> =20 > >>> + > >>> +#if __TIMESIZE !=3D 64 > >>> +libc_hidden_def (__timerfd_gettime64) =20 > >> > >> Ok. > >> > >> As a side note, we should fix it on clock_{get,set}time to add the > >> missing libc_hidden_def. =20 > >=20 > > The clock_gettime already has libc_hidden_def. The difference is > > that we use some compatibility code (after moving clock_gettime > > from librt to libc) instead of strong_alias (as it mimics the > > behavior from auto generated syscall wrapper). =20 >=20 > I meant for the new time64 symbols. Currently it is not an issue > because the internal time64 symbol is not exported and static linker > uses the internal __GI_ name for the symbol. For instance, objdump > -t on clock_gettime.os on a 32-bit architecture (powerpc in this > case) shows: >=20 > 00000144 g F .text 00000088 __clock_gettime > 00000144 g F .text 00000088 __clock_gettime_2 > 00000000 g F .text 00000144 .hidden __GI___clock_gettime64 > 00000144 g F .text 00000088 .hidden __GI___clock_gettime > 00000144 g F .text 00000088 clock_gettime@@GLIBC_2.17 > 00000144 g F .text 00000088 clock_gettime@GLIBC_2.2 >=20 > Where with a libc_hidden_def (__clock_gettime64) it shows: >=20 > 00000144 g F .text 00000088 __clock_gettime > 00000144 g F .text 00000088 __clock_gettime_2 > 00000000 g F .text 00000144 .hidden __GI___clock_gettime64 > *00000000 g F .text 00000144 __clock_gettime64 > 00000144 g F .text 00000088 .hidden __GI___clock_gettime > 00000144 g F .text 00000088 clock_gettime@@GLIBC_2.17 > 00000144 g F .text 00000088 clock_gettime@GLIBC_2.2 >=20 > The requirement of libc_hidden_def will de defined in the end if glibc > exports or not __clock_gettime64 on some header redirection or if=20 The __clock_gettime64 is going to be exported (as clock_gettime redirection) on 32 bit archs which are going to be Y2038 safe (with 64 bit time_t). > clock_gettime64 would be suffice (with a {weak,strong}_alias). >=20 The internal in-glibc usage (calling) of clock_gettime() shall be replaced by either __clock_gettime64 or clock_gettime64. I would prefer the former as it reflects that it is internal function (with __ prefix). > However I do think we should fix it to avoid such confusion why there=20 > is a hidden_proto and not a hidden_def. +1. Best regards, Lukasz Majewski -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de --Sig_/cDEJ5ezM23p=kSUs3fzqhAC Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEgAyFJ+N6uu6+XupJAR8vZIA0zr0FAl4UlNEACgkQAR8vZIA0 zr2NHggAqo9mdAj0rQC+m75fgsi4f24J4wlDRsqMwu3o7NguJr640GQsuncS1hmP F3wbwjFC3Sns61jcogl2Glqaw2aenqmwT7ldpFaR8TeezIEjzgdJaYIsNtO3ji00 DLWCgDKhCKHcHSRffDjEZLuQUwRm1B/oZCWPj8Jf1EolebLPpItkiJs2UkK6t2Wv iAKA8Vty6INj7H1az60aYooz1qsa9RGL0n/x8t9Ib16cUmvYQeN9+KyyMepeV6xD 6ZgC9D7t1SeRQ5NLW7o0VzOF/LBwhEghVXlGQ1zHgxFESnILxSldtIUPp9ORncqd kWUzxFoVUxUCUcV7HYS/cH547HkW+w== =BAnb -----END PGP SIGNATURE----- --Sig_/cDEJ5ezM23p=kSUs3fzqhAC--