[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DF9OOOWQXWK3.2KELKD6VLJP1R@nvidia.com>
Date: Sun, 28 Dec 2025 16:50:07 +0900
From: "Alexandre Courbot" <acourbot@...dia.com>
To: "Matthew Maurer" <mmaurer@...gle.com>, "Miguel Ojeda"
<ojeda@...nel.org>, "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>, "Alice Ryhl" <aliceryhl@...gle.com>,
"Trevor Gross" <tmgross@...ch.edu>, "Danilo Krummrich" <dakr@...nel.org>
Cc: <linux-kernel@...r.kernel.org>, <rust-for-linux@...r.kernel.org>
Subject: Re: [PATCH v3] rust: Add support for feeding entropy to randomness
pool
On Sat Dec 27, 2025 at 4:15 AM JST, Matthew Maurer wrote:
> Adds just enough support to allow device drivers to feed entropy to the
> central pool.
>
> Signed-off-by: Matthew Maurer <mmaurer@...gle.com>
> ---
> Changes in v3:
> - Fixed doclink to be srctree-based instead of relative.
> - Switched to prelude import instead of fine-grained imports.
> - Link to v2: https://lore.kernel.org/r/20251216-add-entropy-v2-1-4d866f251474@google.com
>
> Changes in v2:
> - Added more details in the docs about the API, specifically about it
> not crediting entropy and when it ought to be used.
> - Link to v1: https://lore.kernel.org/r/20251212-add-entropy-v1-1-e70ad1bc9c65@google.com
> ---
> rust/kernel/lib.rs | 1 +
> rust/kernel/rand.rs | 18 ++++++++++++++++++
> 2 files changed, 19 insertions(+)
>
> diff --git a/rust/kernel/lib.rs b/rust/kernel/lib.rs
> index f812cf12004286962985a068665443dc22c389a2..bf64752d276b0bdea06ac0de8a5e219190129377 100644
> --- a/rust/kernel/lib.rs
> +++ b/rust/kernel/lib.rs
> @@ -130,6 +130,7 @@
> pub mod ptr;
> #[cfg(CONFIG_RUST_PWM_ABSTRACTIONS)]
> pub mod pwm;
> +pub mod rand;
> pub mod rbtree;
> pub mod regulator;
> pub mod revocable;
> diff --git a/rust/kernel/rand.rs b/rust/kernel/rand.rs
> new file mode 100644
> index 0000000000000000000000000000000000000000..3e0aef2f53af122f510b34c4743a20452aaad9ad
> --- /dev/null
> +++ b/rust/kernel/rand.rs
> @@ -0,0 +1,18 @@
> +// SPDX-License-Identifier: GPL-2.0
> +
> +//! Randomness.
Let's promote this comment to a sentence at least. :)
> +//!
> +//! C header: [`include/linux/random.h`](srctree/include/linux/random.h)
> +
> +use crate::prelude::*;
> +
> +/// Adds the given buffer to the entropy pool, but does not credit any entropy.
> +///
> +/// This is intended for use mixing in data that is likely to differ between devices or boots, but
Not a native speaker, but "use mixing" sounds a bit off?
With this, and fwiw,
Reviewed-by: Alexandre Courbot <acourbot@...dia.com>
Powered by blists - more mailing lists