chiark / gitweb /
base/dispatch.c, etc.: Check that `rdrand' works.
When probing for `rdrand', check to make sure that it doesn't just
return the same thing every time, and that it can reasonably well make
progress. We check that up to five 32-bit samples are not all the same,
which will mistakenly mark a working CPU as defective with probability
2^-128.
It seems that some processors will return a constant value from `rdrand'
but set the carry flag to indicate that it's properly random anyway.
See
https://arstechnica.com/gadgets/2019/10/how-a-months-old-amd-microcode-bug-destroyed-my-weekend/
as an example.