summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/interface/efi/efi_entropy.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/interface/efi/efi_entropy.c b/src/interface/efi/efi_entropy.c
index a1dfaaa79..a865bad59 100644
--- a/src/interface/efi/efi_entropy.c
+++ b/src/interface/efi/efi_entropy.c
@@ -170,6 +170,10 @@ static int efi_get_noise_rdrand ( noise_sample_t *noise ) {
while ( --retries > 0 ) {
__asm__ volatile ( "rdrand %0; setc %1" : "=r" ( ret ), "=qm" ( ok ) );
if ( ok ) {
+ if ( ret == -1 ) {
+ /* Assume this is a broken AMD CPU, fall back to TSC */
+ ret = profile_timestamp();
+ }
*noise = ret;
return 0;
}