Skip to content

Commit 35605b0

Browse files
authored
Merge pull request #2100 from fwsGonzo/early_rng
x86: Add missing returns in RNG init, and fail avoid TSC with solo5
2 parents d716621 + 19678c4 commit 35605b0

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/platform/x86_pc/rand.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@ void RNG::init()
2424
{
2525
if (CPUID::has_feature(CPUID::Feature::RDSEED)) {
2626
rng_reseed_init(intel_rdseed, 2);
27+
return;
2728
}
2829
else if (CPUID::has_feature(CPUID::Feature::RDRAND)) {
2930
rng_reseed_init(intel_rdrand, 65);
30-
}
31-
else {
32-
rng_reseed_init(fallback_entropy, 64*16);
3331
return;
3432
}
33+
#ifndef PLATFORM_x86_solo5
34+
rng_reseed_init(fallback_entropy, 64*16);
35+
return;
36+
#endif
3537
assert(0 && "No randomness fallback");
3638
}

0 commit comments

Comments
 (0)