mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:07:35 +00:00
Kernel: Add g_cpu_supports_rdseed
CPUs which support RDRAND do not necessarily support RDSEED. This introduces a flag g_cpu_supports_rdseed which is set appropriately by CPUID. This causes Haswell CPUs in particular (and probably a lot of AMD chips) to now fail to boot with #2634, rather than an illegal instruction. It seems like the KernelRng needs either an initial reseed call or more random events added before the first call to get_good_random, but I don't feel qualified to make that kind of change.
This commit is contained in:
parent
ebbcef926a
commit
4fa6301523
3 changed files with 4 additions and 1 deletions
|
@ -714,6 +714,7 @@ bool g_cpu_supports_nx;
|
|||
bool g_cpu_supports_pae;
|
||||
bool g_cpu_supports_pge;
|
||||
bool g_cpu_supports_rdrand;
|
||||
bool g_cpu_supports_rdseed;
|
||||
bool g_cpu_supports_smap;
|
||||
bool g_cpu_supports_smep;
|
||||
bool g_cpu_supports_sse;
|
||||
|
@ -736,6 +737,7 @@ void cpu_detect()
|
|||
g_cpu_supports_smap = (extended_features.ebx() & (1 << 20));
|
||||
g_cpu_supports_smep = (extended_features.ebx() & (1 << 7));
|
||||
g_cpu_supports_umip = (extended_features.ecx() & (1 << 2));
|
||||
g_cpu_supports_rdseed = (extended_features.ebx() & (1 << 18));
|
||||
}
|
||||
|
||||
void cpu_setup()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue