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=-2.9 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_GMAIL_RCVD, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,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 EB8651F463 for ; Sat, 4 Jan 2020 18:03:33 +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:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-type; q=dns; s=default; b=m0ul S5+uYJWXbYqNMs1lhJUxpP/VbRY3YbWtkY888fZcjJCH8FaaaWnVPEAbTlGtdm+f qQPKj8kisoOnYEhJLj4Jqadl0gX4LiOK/6GlNyMoh82PrS6qreaO0c+8XLLDukFF SfMp7vLheLUXP39RYZXTRp8E7DHyQava6iw+qk4= 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:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-type; s=default; bh=dg8ZJLYgox U6mZfxWSKRvPArUlo=; b=K7JVf3degHRPwjnRsFCvHQQQWVikgH9WGIc1nALlLS YWIrjahiycpW19PkzlC48ZcTY47UPfkc+9nNyAlVKdeo0Mh+ydnjyQ31/nviOqfK wZyUy7lPgxaKmqNyyyCqA5hYl07YeVPDS3asqLzsjHCxVBR86Xi6pBsVe00LT2c4 I= Received: (qmail 8523 invoked by alias); 4 Jan 2020 18:03:32 -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 8514 invoked by uid 89); 4 Jan 2020 18:03:31 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: mail-lf1-f67.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=n0c0w0chx9Cn442pJpy1JvcO/xCULQ7GfBr7VX3PChw=; b=RHBGH4iXLUgV181A1vGDaSMrewMo7P9Il9yOE9+cm8t4HaDIBjKZh9PVr26iBGiTpT ZGGkttA80JfxAUnWGjaigktQ1rS5sQX+28kgUOQeUvLszAjgLMu9Te+LWKGhzaEABn/a 3YSbegE2whBPdh5iOLGOZvPxyuyNohUDzcDlX2Ybzj3XPTgStCnVdCPaqr5x+Cwf75ZS M/x5UG12Cu4SjnctovzMCbdnkQph3iUYKqJeOcj/q7NCespdtqUJ1Mj4LaEpxNmiXORw WTqteshTyLVCrNxVl0/qYPz1RoCvl65qZ88QqsmNpmyNXJ0oG0zBLGRnTXJajwGPpBZZ kkDw== MIME-Version: 1.0 References: <20200102130836.77dfed5e@jawa> In-Reply-To: From: Alistair Francis Date: Sat, 4 Jan 2020 10:03:01 -0800 Message-ID: Subject: Re: 32-bit time_t inside itimerval To: Arnd Bergmann Cc: Lukasz Majewski , GNU C Library , Alistair Francis Content-Type: text/plain; charset="UTF-8" On Thu, Jan 2, 2020 at 4:28 AM Arnd Bergmann wrote: > > On Thu, Jan 2, 2020 at 1:08 PM Lukasz Majewski wrote: > > > On Mon, Dec 30, 2019 at 10:22 PM Alistair Francis > > > wrote: > > > > On Mon, Dec 30, 2019 at 12:11 PM Arnd Bergmann wrote: > > > I don't think it's > > > fundamentally different from the other system calls that he has > > > converted already to work with time64 callers. > > > > 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]. > > 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. 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 == 64. I'll send an RFC out with the RV32 patches soon and then send patches when the 2.32 merge window opens up. Alistair > > > 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). > > 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. > > > Arnd, am I correct that the struct itimerval to __kernel_old_itimerval > > conversion patch can be found here [2]? > > 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