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] [day] [month] [year] [list]
Message-ID: <aWkJYyNds5zWpgYE@google.com>
Date: Thu, 15 Jan 2026 15:36:03 +0000
From: Alice Ryhl <aliceryhl@...gle.com>
To: Danilo Krummrich <dakr@...nel.org>
Cc: Lyude Paul <lyude@...hat.com>, dri-devel@...ts.freedesktop.org, 
	rust-for-linux@...r.kernel.org, Daniel Almeida <daniel.almeida@...labora.com>, 
	linux-kernel@...r.kernel.org, Miguel Ojeda <ojeda@...nel.org>, 
	Alex Gaynor <alex.gaynor@...il.com>, Boqun Feng <boqun.feng@...il.com>, 
	Gary Guo <gary@...yguo.net>, 
	"Björn Roy Baron" <bjorn3_gh@...tonmail.com>, Benno Lossin <lossin@...nel.org>, 
	Andreas Hindborg <a.hindborg@...nel.org>, Trevor Gross <tmgross@...ch.edu>, 
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>, Viresh Kumar <viresh.kumar@...aro.org>, 
	FUJITA Tomonori <fujita.tomonori@...il.com>, Krishna Ketan Rai <prafulrai522@...il.com>, 
	Tamir Duberstein <tamird@...il.com>, Xiangfei Ding <dingxiangfei2009@...il.com>, 
	Zhi Wang <zhiw@...dia.com>, Matthew Maurer <mmaurer@...gle.com>, 
	Alexandre Courbot <acourbot@...dia.com>
Subject: Re: [PATCH v6 7/8] rust: Introduce iosys_map bindings

On Thu, Jan 15, 2026 at 12:21:51AM +0100, Danilo Krummrich wrote:
> (Cc: Zhi, Matt, Alex)
> 
> On Tue Dec 2, 2025 at 11:03 PM CET, Lyude Paul wrote:
> > This introduces a set of bindings for working with iosys_map in rust code.
> > The design of this is heavily based off the design for both the io and
> > dma_map bindings for Rust.
> 
> I already had a chat with Lyude about this, but also want to post it here. I
> have mainly two comment on this:
> 
>   (1) The backing memory of iosys_map may be a device resource and hence has to
>       be protected against (bus) device / driver unbind.
> 
>   (2) The idea for the generic I/O infrastructure is to support arbitrary I/O
>       backends rather than only MMIO. For instance, this can also be PCI
>       configuration space, I2C, SPI, etc., but also DMA, VRAM, system memory,
>       etc.
> 
>       For this, there is a patch series from Zhi [1] splitting up the current
>       I/O structures into traits that we will land soon.
> 
>       We will also have macros analogous to dma_read!() and dma_write!() for the
>       generic I/O infrastructure, which Matt also works on for his QC SoC
>       driver.
> 
>       This will allow us to unify all kinds of I/O operations into a single
>       interface, supporting the read!() and write!() accessors for values, the
>       register!() macro and raw accessors, such as e.g. read32().
> 
>       With this we will have something that is way more powerful than iosys_map
>       and makes this abstraction obsolete.

The trait approach generally requires knowing the target type at
compile-time or paying dynamic function calls, but my understanding is
that iosys exists because you might not know which variant you want at
compile-time.

Perhaps we need an

	enum Iosys {
	    SystemMemory(...),
	    DmaMemory(...),
	}

and implement Io for Iosys in terms of the inner types.

Alice

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ