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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DG23FR9ZVL5S.34ON222I49MIW@kernel.org>
Date: Fri, 30 Jan 2026 18:18:23 +0100
From: "Danilo Krummrich" <dakr@...nel.org>
To: "Gary Guo" <gary@...yguo.net>
Cc: "Alexandre Courbot" <acourbot@...dia.com>, "Alice Ryhl"
 <aliceryhl@...gle.com>, "Daniel Almeida" <daniel.almeida@...labora.com>,
 "Miguel Ojeda" <ojeda@...nel.org>, "Boqun Feng" <boqun.feng@...il.com>,
 Björn Roy Baron <bjorn3_gh@...tonmail.com>, "Benno Lossin"
 <lossin@...nel.org>, "Andreas Hindborg" <a.hindborg@...nel.org>, "Trevor
 Gross" <tmgross@...ch.edu>, "Yury Norov" <yury.norov@...il.com>, "John
 Hubbard" <jhubbard@...dia.com>, "Alistair Popple" <apopple@...dia.com>,
 "Joel Fernandes" <joelagnelf@...dia.com>, "Timur Tabi" <ttabi@...dia.com>,
 "Edwin Peer" <epeer@...dia.com>, "Eliot Courtney" <ecourtney@...dia.com>,
 "Dirk Behme" <dirk.behme@...bosch.com>, "Steven Price"
 <steven.price@....com>, <rust-for-linux@...r.kernel.org>,
 <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4 5/7] rust: io: add `register!` macro

On Fri Jan 30, 2026 at 6:01 PM CET, Gary Guo wrote:
> `AsRef` won't work for `Io` which is a trait, unlike `Device` which is a type. A
> custom trait might work but that's more complex than what Alex purposed.

Are we sure about that? For instance, how do we determine the size of the I/O
operation in *_reg()? How can we trust that the type passed to *_reg() is valid
for an arbitrary bit pattern?

I mean, I'm not saying it's possible, but it seems that we end up with a couple
of safety requirements for the base register traits.

> I'm quite fond of the `io.read_reg(REGISTER_REF)` API suggested. It looks quite
> uniform with other I/O acceessor methods, except typed and with constant
> offsets.

It's just a nit, but I find it a bit icky that we have to have something like
the "_reg" suffix.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ