1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 20:47:45 +00:00

Kernel: Fix CPUID usage inside cpu_detect()

Since no features inside the 0x80000001 leaf are required for
SerenityOS to work, don't assert if it's unavailable.
This commit is contained in:
Jean-Baptiste Boric 2021-06-14 23:26:09 +02:00 committed by Andreas Kling
parent fb3447f7ec
commit 8cd96f031d

View file

@ -1003,7 +1003,7 @@ UNMAP_AFTER_INIT void Processor::cpu_detect()
u32 max_extended_leaf = CPUID(0x80000000).eax(); u32 max_extended_leaf = CPUID(0x80000000).eax();
VERIFY(max_extended_leaf >= 0x80000001); if (max_extended_leaf >= 0x80000001) {
CPUID extended_processor_info(0x80000001); CPUID extended_processor_info(0x80000001);
if (extended_processor_info.edx() & (1 << 20)) if (extended_processor_info.edx() & (1 << 20))
set_feature(CPUFeature::NX); set_feature(CPUFeature::NX);
@ -1013,6 +1013,7 @@ UNMAP_AFTER_INIT void Processor::cpu_detect()
// Only available in 64 bit mode // Only available in 64 bit mode
set_feature(CPUFeature::SYSCALL); set_feature(CPUFeature::SYSCALL);
} }
}
if (max_extended_leaf >= 0x80000007) { if (max_extended_leaf >= 0x80000007) {
CPUID cpuid(0x80000007); CPUID cpuid(0x80000007);