lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGM2reZR9iwUoBynrBRbjJAZ1D5WqAKdSzc=xQPWstXs1nN-nw@mail.gmail.com>
Date:   Tue, 19 Jun 2018 10:23:27 -0400
From:   Pavel Tatashin <pasha.tatashin@...cle.com>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     Steven Sistare <steven.sistare@...cle.com>,
        Daniel Jordan <daniel.m.jordan@...cle.com>,
        linux@...linux.org.uk, schwidefsky@...ibm.com,
        Heiko Carstens <heiko.carstens@...ibm.com>,
        john.stultz@...aro.org, sboyd@...eaurora.org, x86@...nel.org,
        LKML <linux-kernel@...r.kernel.org>, mingo@...hat.com,
        tglx@...utronix.de, hpa@...or.com, douly.fnst@...fujitsu.com,
        peterz@...radead.org, prarit@...hat.com, feng.tang@...el.com,
        Petr Mladek <pmladek@...e.com>, gnomes@...rguk.ukuu.org.uk
Subject: Re: [PATCH v10 3/7] x86/time: read_boot_clock64() implementation

> > > +void __init read_boot_clock64(struct timespec64 *now, struct timespec64 *ts)
> > > +{
> > > +       u64 ns_boot = sched_clock_cpu(smp_processor_id());
> > > +       bool valid_clock;
> > > +       u64 ns_now;
> > > +
> > > +       ns_now = timespec64_to_ns(now);
> > > +       valid_clock = ns_boot && timespec64_valid_strict(now) &&
> > > +                       (ns_now > ns_boot);
> > > +
> >
>
>
> > > +       if (!valid_clock)
>
> Are we expecting more often clock to be non-valid?
> Perhaps change to positive conditional?

Hi Andy,

Sure, I will change to:
if (valid_clock)
...
else
...

>
> > > +               *ts = (struct timespec64){0, 0};
>
> I dunno if additional variable would be better for readability, like
>
> struct timespec64 null_ts = {0,0};

I don't mind adding ts_null, but I think, as-is ok here,

> ...
> *ts = null_ts;
>
> > > +       else
> > > +               *ts = ns_to_timespec64(ns_now - ns_boot);
>
> But I'm fine as long as Thomas is okay with this code.
>

Thank you for the review!

Pavel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ