Kernel: Detect support for CPUID FXSR

The fxsave and fxrstor instructions are available only if the FXSR
feature is present.
This commit is contained in:
Jean-Baptiste Boric 2021-06-14 23:59:38 +02:00 committed by Andreas Kling
parent 90873781c1
commit fea23d0ec1
Notes: sideshowbarker 2024-07-18 12:06:33 +09:00
2 changed files with 5 additions and 0 deletions

View File

@ -971,6 +971,8 @@ UNMAP_AFTER_INIT void Processor::cpu_detect()
set_feature(CPUFeature::PGE);
if (processor_info.edx() & (1 << 23))
set_feature(CPUFeature::MMX);
if (processor_info.edx() & (1 << 24))
set_feature(CPUFeature::FXSR);
if (processor_info.edx() & (1 << 25))
set_feature(CPUFeature::SSE);
if (processor_info.edx() & (1 << 26))
@ -1137,6 +1139,8 @@ String Processor::features_string() const
return "syscall";
case CPUFeature::MMX:
return "mmx";
case CPUFeature::FXSR:
return "fxsr";
case CPUFeature::SSE2:
return "sse2";
case CPUFeature::SSE3:

View File

@ -548,6 +548,7 @@ enum class CPUFeature : u32 {
SSE4_2 = (1 << 20),
XSAVE = (1 << 21),
AVX = (1 << 22),
FXSR = (1 << 23),
};
class Thread;