rdrand: Enable the RDSEED instruction

Enable the use of the RDSEED instruction.  Since RDSEED can more
easily be starved of entropy due to use on other threads, allow it to
fall back to RDRAND by having a function which for every RDSEED
failure executes RDRAND and stores a sample in a separate buffer.

The RDRAND buffer and its high water mark are made static so that they
can accumulate data across multiple invocations.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2 files changed