x86, random: Verify RDRAND functionality and allow it to be disabled
authorH. Peter Anvin <hpa@zytor.com>
Sun, 31 Jul 2011 21:02:19 +0000 (14:02 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 21 Oct 2012 16:17:12 +0000 (09:17 -0700)
commit8b9b3bf4e79b8f41fa910932885526c2d1083af9
tree13ccd050915a838b801c99aaf5a06a4a6c89bdc6
parent5faf9fc361bac926a2f9efe6018fdc16c0e7dad8
x86, random: Verify RDRAND functionality and allow it to be disabled

commit 49d859d78c5aeb998b6936fcb5f288f78d713489 upstream.

If the CPU declares that RDRAND is available, go through a guranteed
reseed sequence, and make sure that it is actually working (producing
data.)   If it does not, disable the CPU feature flag.

Allow RDRAND to be disabled on the command line (as opposed to at
compile time) for a user who has special requirements with regards to
random numbers.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Cc: Matt Mackall <mpm@selenic.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Documentation/kernel-parameters.txt
arch/x86/include/asm/archrandom.h
arch/x86/kernel/cpu/Makefile
arch/x86/kernel/cpu/common.c
arch/x86/kernel/cpu/rdrand.c [new file with mode: 0644]