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=-4.0 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 110761F46C for ; Sun, 5 Jan 2020 16:07:38 +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=A5TxT 5DqdUcYU7K+xe3QbcyISQWBE8r/6Q1ksWRHgaIEQbPNkEc4ExlYd4QBxFaGrmad1 ScgzRKjpzK1vLEUO3YvhaRhrbKX1T+viyVlplFTK3UXwuQGAWljJdZWdX/M4P5nv mkSV3Bh6Cdnr7ZrFz41daSp9cQ+5PJZ5tSJEio= 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=kiILKjz/mvd yxrQ3aa1/zLrjoag=; b=AyUNHNP9TxuERjSDmqRx596qY9YvymZOsgUb58RHxSK PTLxORxNNuWXX6CIPm8nxEcy5VRBgma/ivpulAFm9CTz7gL20Up92HZ/YPhzBWuX S7ElbzVsRNxKMzDK3L3kwLIso69tmlpPsFDg9PQRJ9akX8GdyK1GKTtfEe+vAt8w = Received: (qmail 12394 invoked by alias); 5 Jan 2020 16:07:35 -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 12145 invoked by uid 89); 5 Jan 2020 16:07:35 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: mail-out.m-online.net Date: Sun, 5 Jan 2020 17:07:19 +0100 From: Lukasz Majewski To: Alistair Francis Cc: Arnd Bergmann , GNU C Library , Alistair Francis Subject: Re: 32-bit time_t inside itimerval Message-ID: <20200105170719.58719d39@jawa> In-Reply-To: References: <20200102130836.77dfed5e@jawa> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/oybSGOluYLWseZDj3FKMDGp"; protocol="application/pgp-signature" --Sig_/oybSGOluYLWseZDj3FKMDGp Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi Alistair, > On Thu, Jan 2, 2020 at 4:28 AM Arnd Bergmann wrote: > > > > On Thu, Jan 2, 2020 at 1:08 PM Lukasz Majewski > > wrote: =20 > > > > On Mon, Dec 30, 2019 at 10:22 PM Alistair Francis > > > > wrote: =20 > > > > > On Mon, Dec 30, 2019 at 12:11 PM Arnd Bergmann > > > > > wrote: =20 > > > > I don't think it's > > > > fundamentally different from the other system calls that he has > > > > converted already to work with time64 callers. =20 > > > > > > I'm not aware of any RV32 specifics, but it seems to me that it > > > would be appropriate to use the 64 bit version of struct > > > __itimerspec64 in glibc - as for example in the conversion patch > > > from [1]. =20 > > > > What I mean is that rv32 otherwise does not convert between time32 > > and time64 interfaces because it always uses the time64 version, > > so unlike the others, there is probably no helper to convert between > > the timeval formats either. =20 >=20 > I have some patches prepared that will convert a 64-bit time_t to > 32-bit for the required syscalls. It's generic for 32-bit archs, but > will only apply when __TIMESIZE =3D=3D 64. >=20 > I'll send an RFC out with the RV32 patches soon and then send patches > when the 2.32 merge window opens up. Great. Thanks :-) >=20 >=20 > Alistair >=20 > > =20 > > > As it was already mentioned - those calls set the time to be > > > decremented and do not operate on "absolute" time values. > > > Hence, I think that it would be good enough (for now?) to use 32 > > > bit API wrapped into 64 bit internal glibc values and just return > > > errors when somebody wants to set timer relative expiration time > > > to overflow time_t on 32 bit archs (arm,rv32). =20 > > > > Yes, that's the idea. The kernel already limits the range to 64-bit > > nanoseconds because of its timer implementation, so truncating it > > to 32-bit seconds does not change the behavior either. > > =20 > > > Arnd, am I correct that the struct itimerval to > > > __kernel_old_itimerval conversion patch can be found here [2]? =20 > > > > Yes, that's right. This patch only changes the in-kernel > > implementation as a step to removing the timeval definition from > > the kernel's uapi headers, it does not change the behavior at all. > > > > Arnd =20 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_/oybSGOluYLWseZDj3FKMDGp Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEgAyFJ+N6uu6+XupJAR8vZIA0zr0FAl4SCbcACgkQAR8vZIA0 zr3frAf/T4F5LMOXZr11RjOx9INmv8ETp+solOqQ5EBERHXc9xQ2LNqy+9W7JAYd 3vlVzdjSrgjhygIra1AIA0ABUVGnFOdRnmNKH3e+wma9JWTjAKkZxGiLxJm1LV9V luLICUNKfYDME6KfRCrlQglwkEqXdA7p2KhqFzUulHasd4YkQYx48fQ1RGuIXj6M oH4ILgTR/OF81n6VwA4OlOOHLaKOjQOGN6rEBRhUDg5d/KECO/gUieGlI0N4o+z5 WUN/Ok+OJXRGSvHA1TkwcJoK9+kLsa77G961+kjpN/b0ZRRxn1txMjIS+cf5NATV itZNWE0x83SJlmL2s5iPHdTmGC/2VA== =Hfs/ -----END PGP SIGNATURE----- --Sig_/oybSGOluYLWseZDj3FKMDGp--