From: Eric Biggers <ebiggers@kernel.org>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: linux-kernel@vger.kernel.org, Theodore Ts'o <tytso@mit.edu>,
Dominik Brodowski <linux@dominikbrodowski.net>
Subject: Re: [PATCH v2] random: unify early init crng load accounting
Date: Mon, 21 Feb 2022 11:18:29 -0800 [thread overview]
Message-ID: <YhPlhWAPokRMpSyt@sol.localdomain> (raw)
In-Reply-To: <20220221152456.2289150-1-Jason@zx2c4.com>
On Mon, Feb 21, 2022 at 04:24:56PM +0100, Jason A. Donenfeld wrote:
> crng_fast_load() and crng_slow_load() have different semantics:
>
> - crng_fast_load() xors and accounts with crng_init_cnt.
> - crng_slow_load() hashes and doesn't account.
>
> However add_hwgenerator_randomness() can afford to hash (it's called
> from a kthread), and it should account. Additionally, ones that can
> afford to hash don't need to take a trylock but can take a normal lock.
> So, we combine these into one function, crng_pre_init_inject(), which
> allows us to control these in a uniform way. This will make it simpler
> later to simplify this all down when the time comes for that.
>
> Cc: Theodore Ts'o <tytso@mit.edu>
> Reviewed-by: Dominik Brodowski <linux@dominikbrodowski.net>
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
> ---
> Changes v1->v2:
> - cp -> input,
> - fix comment reference to old function,
> - fix brace style.
>
> drivers/char/random.c | 112 ++++++++++++++++++++++--------------------
> 1 file changed, 58 insertions(+), 54 deletions(-)
Reviewed-by: Eric Biggers <ebiggers@google.com>
- Eric
prev parent reply other threads:[~2022-02-21 19:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-21 15:24 [PATCH v2] random: unify early init crng load accounting Jason A. Donenfeld
2022-02-21 19:18 ` Eric Biggers [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YhPlhWAPokRMpSyt@sol.localdomain \
--to=ebiggers@kernel.org \
--cc=Jason@zx2c4.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@dominikbrodowski.net \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox