HomeFreeBSD

Add an Armv8 rndr random number provider

Description

Add an Armv8 rndr random number provider

Armv8.5 adds an optional random number generator. This is implemented
as two special registers one to read a random number, the other to
re-seed the entropy pool before reading a random number. Both registers
will set the condition flags to tell the caller they can't produce a
random number in a reasonable amount of time.

Without a signal to reseed the entropy pool use the latter register
to provide random numbers to the kernel pool. If at a later time we
had a way to tell the provider if it needs to reseed or not we could
use the former.

On an Amazon AWS Graviton3 VM this never failed, however this may not
be the case on low end CPUs so retry reading the random number 10 times
before returning an error.

Reviewed by: imp, delphij (csprng)
Sponsored by: The FreeBSD Foundation
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D35411

Details

Provenance
andrewAuthored on Nov 15 2023, 5:42 PM
Reviewer
imp
Differential Revision
D35411: Add an Armv8 rndr random number provider
Parents
rG61f14f1da37b: arm64: Clean up finding our load address
Branches
Unknown
Tags
Unknown