summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorJean-Baptiste Boric <jblbeurope@gmail.com>2021-06-14 23:26:09 +0200
committerAndreas Kling <kling@serenityos.org>2021-06-18 01:02:25 +0200
commit8cd96f031d5f826a5f5b67ef3dcf6a9d4341ed95 (patch)
tree43218eb66771459d1cb8e5f75014d299aee64fdd /Kernel
parentfb3447f7ecac53a40e7ff7ccc39bd83317154468 (diff)
downloadserenity-8cd96f031d5f826a5f5b67ef3dcf6a9d4341ed95.zip
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.
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/Arch/i386/CPU.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/Kernel/Arch/i386/CPU.cpp b/Kernel/Arch/i386/CPU.cpp
index 4cb3533fd0..7d13a29ec3 100644
--- a/Kernel/Arch/i386/CPU.cpp
+++ b/Kernel/Arch/i386/CPU.cpp
@@ -1003,15 +1003,16 @@ UNMAP_AFTER_INIT void Processor::cpu_detect()
u32 max_extended_leaf = CPUID(0x80000000).eax();
- VERIFY(max_extended_leaf >= 0x80000001);
- CPUID extended_processor_info(0x80000001);
- if (extended_processor_info.edx() & (1 << 20))
- set_feature(CPUFeature::NX);
- if (extended_processor_info.edx() & (1 << 27))
- set_feature(CPUFeature::RDTSCP);
- if (extended_processor_info.edx() & (1 << 11)) {
- // Only available in 64 bit mode
- set_feature(CPUFeature::SYSCALL);
+ if (max_extended_leaf >= 0x80000001) {
+ CPUID extended_processor_info(0x80000001);
+ if (extended_processor_info.edx() & (1 << 20))
+ set_feature(CPUFeature::NX);
+ if (extended_processor_info.edx() & (1 << 27))
+ set_feature(CPUFeature::RDTSCP);
+ if (extended_processor_info.edx() & (1 << 11)) {
+ // Only available in 64 bit mode
+ set_feature(CPUFeature::SYSCALL);
+ }
}
if (max_extended_leaf >= 0x80000007) {