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: <878qvzbtz1.ffs@tglx>
Date: Tue, 10 Sep 2024 13:58:58 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: Jeff Layton <jlayton@...nel.org>, John Stultz <jstultz@...gle.com>,
 Stephen Boyd <sboyd@...nel.org>
Cc: Vadim Fedorenko <vadim.fedorenko@...ux.dev>,
 linux-kernel@...r.kernel.org, Jeff Layton <jlayton@...nel.org>
Subject: Re: [PATCH RFC] timekeeping: don't use seqcount loop in
 ktime_mono_to_any on 64-bit arch

On Tue, Sep 10 2024 at 07:17, Jeff Layton wrote:

Please describe functions with foo() and not foo. Also please refrain
from using abbreviations. The 'arch' above is not really useful.

64-bit systems perhaps?

> ktime_mono_to_any only fetches the offset inside the loop. This is a
> single word on 64-bit arch, and seqcount_read_begin implies a full SMP
> barrier. While we do want to use the latest offset value available, a

We do nothing.

> full seqcount loop is overkill on 64-bit, where there is no possibility
> of torn reads. Just do a READ_ONCE for that and don't bother with the
> seqcount.

don't bother is not really a technical term.

https://www.kernel.org/doc/html/latest/process/maintainer-tip.html#changelog

> +#if BITS_PER_LONG == 64
> +ktime_t ktime_mono_to_any(ktime_t tmono, enum tk_offsets offs)
> +{
> +	ktime_t *offset = offsets[offs];
> +
> +	return ktime_add(tmono, READ_ONCE(*offset));

Where is the corresponing WRITE_ONCE()?

> +}
> +EXPORT_SYMBOL_GPL(ktime_mono_to_any);
> +#else /* BITS_PER_LONG == 64 */
>  EXPORT_SYMBOL_GPL(ktime_mono_to_any);
> +#endif /* BITS_PER_LONG == 64 */

Why do we need this export twice?

Thanks,

        tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ