[v2] powerpc: Use hardware RNG for arch_get_random_seed_* not arch_get_random_*

Michael Ellerman mpe at ellerman.id.au
Mon Aug 3 11:35:03 AEST 2015

On Fri, 2015-17-07 at 10:11:43 UTC, Paul Mackerras wrote:
> The hardware RNG on POWER8 and POWER7+ can be relatively slow, since
> it can only supply one 64-bit value per microsecond.  Currently we
> read it in arch_get_random_long(), but that slows down reading from
> /dev/urandom since the code in random.c calls arch_get_random_long()
> for every longword read from /dev/urandom.
> Since the hardware RNG supplies high-quality entropy on every read, it
> matches the semantics of arch_get_random_seed_long() better than those
> of arch_get_random_long().  Therefore this commit makes the code use
> the POWER8/7+ hardware RNG only for arch_get_random_seed_{long,int}
> and not for arch_get_random_{long,int}.
> This won't affect any other PowerPC-based platforms because none of
> them currently support a hardware RNG.  To make it clear that the
> ppc_md function pointer is used for arch_get_random_seed_*, we rename
> it from get_random_long to get_random_seed.
> Signed-off-by: Paul Mackerras <paulus at samba.org>

Applied to powerpc next, thanks.



More information about the Linuxppc-dev mailing list