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-next>] [day] [month] [year] [list]
Message-ID: <20260205224706.91996-2-dakr@kernel.org>
Date: Thu,  5 Feb 2026 23:31:23 +0100
From: Danilo Krummrich <dakr@...nel.org>
To: gregkh@...uxfoundation.org,
	rafael@...nel.org,
	ojeda@...nel.org,
	boqun.feng@...il.com,
	gary@...yguo.net,
	bjorn3_gh@...tonmail.com,
	lossin@...nel.org,
	a.hindborg@...nel.org,
	aliceryhl@...gle.com,
	tmgross@...ch.edu
Cc: driver-core@...ts.linux.dev,
	rust-for-linux@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Danilo Krummrich <dakr@...nel.org>
Subject: [PATCH 0/5] Use struct devres_node in Devres<T>

Currently, the Devres<T> container uses devm_add_action() to register a
devres callback.

devm_add_action() allocates a struct action_devres, which on top of
struct devres_node, just keeps a data pointer and release function
pointer.

This is an unnecessary indirection, given that analogous to struct
devres, the Devres<T> container can just embed a struct devres_node
directly without an additional allocation.

In contrast to struct devres, we don't need to force an alignment of
ARCH_DMA_MINALIGN (as struct devres does to account for the worst case)
since we have generics in Rust. I.e. the compiler already ensures
correct alignment of the embedded T in Devres<T>.

Thus, get rid of devm_add_action() and instead embed a struct
devres_node directly.

This patch series is based on [1] and [2].

[1] https://lore.kernel.org/lkml/20260205222529.91465-1-dakr@kernel.org/
[2] https://lore.kernel.org/lkml/20260202235210.55176-1-dakr@kernel.org/

Danilo Krummrich (5):
  devres: move struct devres_node into base.h
  devres: export devres_node_init() and devres_node_add()
  devres: add devres_node_remove()
  devres: rename and export set_node_dbginfo()
  rust: devres: embed struct devres_node directly

 drivers/base/base.h   |  18 +++++++
 drivers/base/devres.c |  54 +++++++++++--------
 rust/kernel/devres.rs | 123 ++++++++++++++++++++++++++----------------
 3 files changed, 127 insertions(+), 68 deletions(-)


base-commit: c98d3727720db5f74bf40a8cd1c2da05081845ee
-- 
2.52.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ