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: <CANiq72mMRpY4NC4_8v_wDpq6Z3qs99Y8gXd-7XL_3Bed58gkJg@mail.gmail.com>
Date: Tue, 29 Apr 2025 16:35:09 +0200
From: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To: FUJITA Tomonori <fujita.tomonori@...il.com>
Cc: a.hindborg@...nel.org, rust-for-linux@...r.kernel.org, gary@...yguo.net, 
	aliceryhl@...gle.com, me@...enk.dev, daniel.almeida@...labora.com, 
	linux-kernel@...r.kernel.org, netdev@...r.kernel.org, andrew@...n.ch, 
	hkallweit1@...il.com, tmgross@...ch.edu, ojeda@...nel.org, 
	alex.gaynor@...il.com, bjorn3_gh@...tonmail.com, benno.lossin@...ton.me, 
	a.hindborg@...sung.com, anna-maria@...utronix.de, frederic@...nel.org, 
	tglx@...utronix.de, arnd@...db.de, jstultz@...gle.com, sboyd@...nel.org, 
	mingo@...hat.com, peterz@...radead.org, juri.lelli@...hat.com, 
	vincent.guittot@...aro.org, dietmar.eggemann@....com, rostedt@...dmis.org, 
	bsegall@...gle.com, mgorman@...e.de, vschneid@...hat.com, tgunders@...hat.com, 
	david.laight.linux@...il.com, boqun.feng@...il.com, pbonzini@...hat.com, 
	jfalempe@...hat.com, linux@...linux.org.uk, chrisi.schrefl@...il.com, 
	linus.walleij@...aro.org
Subject: Re: [PATCH v15 5/6] rust: time: Add wrapper for fsleep() function

On Tue, Apr 29, 2025 at 3:17 PM FUJITA Tomonori
<fujita.tomonori@...il.com> wrote:
>
> Ah, 64-bit integer division on 32-bit architectures.
>
> I think that the DRM QR driver has the same problem:
>
> https://lore.kernel.org/rust-for-linux/CANiq72ke45eOwckMhWHvmwxc03dxr4rnxxKvx+HvWdBLopZfrQ@mail.gmail.com/

Yeah.

> It appears that there is still no consensus on how to resolve it. CC
> the participants in the above thread.
>
> I think that we can drop this patch and better to focus on Instant and
> Delta types in this merge window.
>
> With the patch below, this issue could be resolved like the C side,
> but I'm not sure whether we can reach a consensus quickly.

I think using the C ones is fine for the moment, but up to what arm
and others think.

This one is also a constant, so something simpler may be better (and
it is also a power of 10 divisor, so the other suggestions on that
thread would apply too).

> +/// Divide a signed 64-bit integer by another signed 64-bit integer.

Perhaps an example wouldn't hurt. And if `unsafe` or fallible is
picked, then the example allows to showcase (and test) what happens in
the zero divisor case that Christian points out.

By the way, apart from that case, we should also consider the min/-1 case.

We may want an assert under `CONFIG_RUST_OVERFLOW_CHECKS=y`, too.

And it wouldn't hurt to test a few other boundary values, with the new
`#[test]` support.

Thanks!

Cheers,
Miguel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ