Navigation Menu

Skip to content

Commit

Permalink
x86: Add missing returns in RNG init, and fail avoid TSC with solo5
Browse files Browse the repository at this point in the history
  • Loading branch information
fwsGonzo committed Mar 26, 2019
1 parent 3b26db0 commit 19678c4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/platform/x86_pc/rand.cpp
Expand Up @@ -24,13 +24,15 @@ void RNG::init()
{
if (CPUID::has_feature(CPUID::Feature::RDSEED)) {
rng_reseed_init(intel_rdseed, 2);
return;
}
else if (CPUID::has_feature(CPUID::Feature::RDRAND)) {
rng_reseed_init(intel_rdrand, 65);
}
else {
rng_reseed_init(fallback_entropy, 64*16);
return;
}
#ifndef PLATFORM_x86_solo5
rng_reseed_init(fallback_entropy, 64*16);
return;
#endif
assert(0 && "No randomness fallback");
}

0 comments on commit 19678c4

Please sign in to comment.