From: Will Deacon <will@kernel.org>
To: Ard Biesheuvel <ardb@kernel.org>, tytso@mit.edu
Cc: catalin.marinas@arm.com, kernel-team@android.com,
Will Deacon <will@kernel.org>,
mark.rutland@arm.com, broonie@kernel.org,
linux-arm-kernel@lists.infradead.org, maz@kernel.org,
linux-kernel@vger.kernel.org, andre.przywara@arm.com
Subject: Re: [PATCH] random: avoid arch_get_random_seed_long() when collecting IRQ randomness
Date: Thu, 21 Jan 2021 17:53:18 +0000 [thread overview]
Message-ID: <161124379345.536991.7126735996539393054.b4-ty@kernel.org> (raw)
In-Reply-To: <20201105152944.16953-1-ardb@kernel.org>
On Thu, 5 Nov 2020 16:29:44 +0100, Ard Biesheuvel wrote:
> When reseeding the CRNG periodically, arch_get_random_seed_long() is
> called to obtain entropy from an architecture specific source if one
> is implemented. In most cases, these are special instructions, but in
> some cases, such as on ARM, we may want to back this using firmware
> calls, which are considerably more expensive.
>
> Another call to arch_get_random_seed_long() exists in the CRNG driver,
> in add_interrupt_randomness(), which collects entropy by capturing
> inter-interrupt timing and relying on interrupt jitter to provide
> random bits. This is done by keeping a per-CPU state, and mixing in
> the IRQ number, the cycle counter and the return address every time an
> interrupt is taken, and mixing this per-CPU state into the entropy pool
> every 64 invocations, or at least once per second. The entropy that is
> gathered this way is credited as 1 bit of entropy. Every time this
> happens, arch_get_random_seed_long() is invoked, and the result is
> mixed in as well, and also credited with 1 bit of entropy.
>
> [...]
Applied to arm64 (for-next/random), thanks!
[1/1] random: avoid arch_get_random_seed_long() when collecting IRQ randomness
https://git.kernel.org/arm64/c/390596c9959c
Ted -- please shout if you would prefer me not to carry this in the arm64
tree. I've haven't seen a response from you on this thread, but this patch
is currently blocking support for the TRNG firmware call on arm64 [1], so
I've pulled it in as a dependency. The branch above is stable, so you can
pull it in as well if necessary.
[1] https://lore.kernel.org/r/20210106103453.152275-1-andre.przywara@arm.com
Cheers,
--
Will
https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev
prev parent reply other threads:[~2021-01-21 17:55 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-05 15:29 Ard Biesheuvel
2020-11-11 8:19 ` Ard Biesheuvel
2020-11-11 9:45 ` André Przywara
2020-11-11 10:05 ` Ard Biesheuvel
2020-11-11 10:46 ` André Przywara
2020-11-11 11:48 ` Ard Biesheuvel
2020-11-17 13:33 ` Ard Biesheuvel
2021-01-04 19:09 ` Ard Biesheuvel
2021-01-10 9:45 ` Ard Biesheuvel
2021-01-15 13:18 ` Jason A. Donenfeld
2020-11-20 4:11 ` Eric Biggers
2020-12-01 12:23 ` Ard Biesheuvel
2020-12-07 8:12 ` Ard Biesheuvel
2020-12-07 14:27 ` Jason A. Donenfeld
2020-12-07 15:35 ` Ard Biesheuvel
2020-11-20 15:27 ` Marc Zyngier
2020-11-27 12:08 ` Ard Biesheuvel
2021-01-21 17:53 ` Will Deacon [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=161124379345.536991.7126735996539393054.b4-ty@kernel.org \
--to=will@kernel.org \
--cc=andre.przywara@arm.com \
--cc=ardb@kernel.org \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=kernel-team@android.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=maz@kernel.org \
--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
all inboxes | Powered by JetHome®