mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:27:44 +00:00
Kernel: Query OS-enabled CPUID features again at the end of cpu_setup()
For OSPKE this is a no-op as we don't enable PKU yet, but the state of the OSXSAVE flag might have changed if we enabled XSAVE.
This commit is contained in:
parent
87aabb5ef7
commit
62185452f0
1 changed files with 8 additions and 0 deletions
|
@ -594,6 +594,14 @@ UNMAP_AFTER_INIT void Processor::cpu_setup()
|
||||||
MSR sfmask_msr(MSR_SFMASK);
|
MSR sfmask_msr(MSR_SFMASK);
|
||||||
sfmask_msr.set(rflags_mask);
|
sfmask_msr.set(rflags_mask);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Query OS-enabled CPUID features again, and set the flags if needed.
|
||||||
|
CPUID processor_info(0x1);
|
||||||
|
if (processor_info.ecx() & (1 << 27))
|
||||||
|
m_features |= CPUFeature::OSXSAVE;
|
||||||
|
CPUID extended_features(0x7);
|
||||||
|
if (extended_features.ecx() & (1 << 4))
|
||||||
|
m_features |= CPUFeature::OSPKE;
|
||||||
}
|
}
|
||||||
|
|
||||||
UNMAP_AFTER_INIT void Processor::early_initialize(u32 cpu)
|
UNMAP_AFTER_INIT void Processor::early_initialize(u32 cpu)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue