unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Lukasz Majewski <lukma@denx.de>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Alistair Francis <alistair23@gmail.com>,
	GNU C Library <libc-alpha@sourceware.org>,
	Alistair Francis <alistair.francis@wdc.com>
Subject: Re: 32-bit time_t inside itimerval
Date: Thu, 2 Jan 2020 13:08:36 +0100	[thread overview]
Message-ID: <20200102130836.77dfed5e@jawa> (raw)
In-Reply-To: <CAK8P3a0zbcTMr0fQB35E9Y9r0DUS9-W4h9z1zOv+coKiH56HZg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2666 bytes --]

Hi Arnd, Alistair,

Sorry to jump in lately - Christmas period :-)

> On Mon, Dec 30, 2019 at 10:22 PM Alistair Francis
> <alistair23@gmail.com> wrote:
> > On Mon, Dec 30, 2019 at 12:11 PM Arnd Bergmann <arnd@arndb.de>
> > wrote:  
> > > On Mon, Dec 30, 2019 at 8:57 PM Alistair Francis
> > > <alistair23@gmail.com> wrote:  
> > > >
> > > > Yeah, agreed. I have updated the RV32 port to internally convert
> > > > between 32/64-bit.  
> > >
> > > Any chance of making this the default implementation for 32-bit
> > > rather than RV32 specific? The code should be the same for any
> > > time64 user space regardless of the architecture.  
> >
> > I was thinking about this.
> >
> > I don't know of a good way to make it apply only to 32-bit archs
> > with a 64-bit time_t.This could actually just apply to all 32-bit
> > archs. That way ones that are 64-bit time_t are covered and ones
> > that aren't will just do an extra conversion with no effect.
> >
> > Making it 32-bit in general seems reasonable to me, I just have to
> > figure out a way to test it though.  
> 
> Maybe Lukasz already has a plan for this,

I did not do any work regarding {set|get}itimer. I've instead focused on
timer_fd[sg]ettime for now [1].

> 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].

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).

(The above approach would also simplify latter glibc switch to *_time64
syscalls when introduced).

> 
>       Arnd

Arnd, am I correct that the struct itimerval to __kernel_old_itimerval
conversion patch can be found here [2]? 


Links:

[1] - https://patchwork.ozlabs.org/patch/1211482/
[2] -
https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git/commit/?h=y2038&id=4f9fbd893fe83a1193adceca41c8f7aa6c7382a1


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

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2020-01-02 12:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-20 22:28 32-bit time_t inside itimerval Alistair Francis
2019-12-21 13:31 ` Arnd Bergmann
2019-12-21 17:18   ` Alistair Francis
2019-12-30 10:02     ` Arnd Bergmann
2019-12-30 19:51       ` Alistair Francis
2019-12-30 20:11         ` Arnd Bergmann
2019-12-30 21:16           ` Alistair Francis
2019-12-30 22:11             ` Arnd Bergmann
2020-01-02 12:08               ` Lukasz Majewski [this message]
2020-01-02 12:28                 ` Arnd Bergmann
2020-01-04 18:03                   ` Alistair Francis
2020-01-05 16:07                     ` Lukasz Majewski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200102130836.77dfed5e@jawa \
    --to=lukma@denx.de \
    --cc=alistair.francis@wdc.com \
    --cc=alistair23@gmail.com \
    --cc=arnd@arndb.de \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).