From: Andre Przywara <andre.przywara@arm.com>
To: Theodore Ts'o <tytso@mit.edu>
Cc: Mark Rutland <mark.rutland@arm.com>,
Catalin Marinas <catalin.marinas@arm.com>,
linux-kernel@vger.kernel.org, Mark Brown <broonie@kernel.org>,
Will Deacon <will@kernel.org>,
linux-arm-kernel@lists.infradead.org
Subject: [PATCH] random: Use arch_get_random_long_early() for init_std_data()
Date: Fri, 13 Nov 2020 16:19:12 +0000 [thread overview]
Message-ID: <20201113161912.62068-1-andre.przywara@arm.com> (raw)
In commit 253d3194c2b5 ("random: add arch_get_random_*long_early()") we
introduced _early versions of arch_get_random_long(), that are used on
arm64 to use the CPU RNDR instruction early in the boot process, before
we have established system-wide availability.
This covers the calls in crng_initialize_primary(), but missed the calls
in init_std_data(), happening just before that.
Use the _early versions of the arch_get_random* calls also in
init_std_data(), to help initialising the pool with proper seed values.
Fixes: 253d3194c2b5 ("random: add arch_get_random_*long_early()")
Cc: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
drivers/char/random.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/char/random.c b/drivers/char/random.c
index 2a41b21623ae..43bb331a67bd 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -1778,8 +1778,8 @@ static void __init init_std_data(struct entropy_store *r)
mix_pool_bytes(r, &now, sizeof(now));
for (i = r->poolinfo->poolbytes; i > 0; i -= sizeof(rv)) {
- if (!arch_get_random_seed_long(&rv) &&
- !arch_get_random_long(&rv))
+ if (!arch_get_random_seed_long_early(&rv) &&
+ !arch_get_random_long_early(&rv))
rv = random_get_entropy();
mix_pool_bytes(r, &rv, sizeof(rv));
}
--
2.17.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2020-11-13 16:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-13 16:19 Andre Przywara [this message]
2020-11-16 13:20 ` [PATCH] random: Use arch_get_random_long_early() for init_std_data() Will Deacon
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=20201113161912.62068-1-andre.przywara@arm.com \
--to=andre.przywara@arm.com \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=tytso@mit.edu \
--cc=will@kernel.org \
/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