summaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/msr.h
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2015-08-16 11:20:00 -0400
committerThomas Gleixner <tglx@linutronix.de>2015-11-25 22:46:43 +0100
commit0007bccc3cfd1e69deb0fd73ccc426b4cedb061d (patch)
tree423cce8e35657ce49c6afb6e9f6bf9e3bc8fe2b7 /arch/x86/include/asm/msr.h
parent679bcea857d72868e3431dde3a0e158bf0ed9119 (diff)
downloadlinux-0-day-0007bccc3cfd1e69deb0fd73ccc426b4cedb061d.tar.gz
linux-0-day-0007bccc3cfd1e69deb0fd73ccc426b4cedb061d.tar.xz
x86: Replace RDRAND forced-reseed with simple sanity check
x86_init_rdrand() was added with 2 goals: 1. Sanity check that the built-in-self-test circuit on the Digital Random Number Generator (DRNG) is not complaining. As RDRAND HW self-checks on every invocation, this goal is achieved by simply invoking RDRAND and checking its return code. 2. Force a full re-seed of the random number generator. This was done out of paranoia to benefit the most un-sophisticated DRNG implementation conceivable in the architecture, an implementation that does not exist, and unlikely ever will. This worst-case full-re-seed is achieved by invoking a 64-bit RDRAND 8192 times. Unfortunately, this worst-case re-seed costs O(1,000us). Magnifying this cost, it is done from identify_cpu(), which is the synchronous critical path to bring a processor on-line -- repeated for every logical processor in the system at boot and resume from S3. As it is very expensive, and of highly dubious value, we delete the worst-case re-seed from the kernel. We keep the 1st goal -- sanity check the hardware, and mark it absent if it complains. This change reduces the cost of x86_init_rdrand() by a factor of 1,000x, to O(1us) from O(1,000us). Signed-off-by: Len Brown <len.brown@intel.com> Link: http://lkml.kernel.org/r/058618cc56ec6611171427ad7205e37e377aa8d4.1439738240.git.len.brown@intel.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/include/asm/msr.h')
0 files changed, 0 insertions, 0 deletions