1
0
Fork 0
mirror of https://github.com/hermitcore/libhermit.git synced 2025-03-09 00:00:03 +01:00

add detection of VMX

This commit is contained in:
Stefan Lankes 2015-12-08 22:14:52 +01:00
parent 8477db976f
commit 8f4fdc9559
2 changed files with 7 additions and 1 deletions

View file

@ -63,6 +63,7 @@ extern "C" {
// feature list 0x00000001 (ecx)
#define CPU_FEATURE_MWAIT (1 << 3)
#define CPU_FEATURE_VMX (1 << 5)
#define CPU_FEATURE_SSE3 (1 << 9)
#define CPU_FEATURE_FMA (1 << 12)
#define CPU_FEATURE_DCA (1 << 18)
@ -261,6 +262,10 @@ inline static uint32_t has_mwait(void) {
return (cpu_info.feature2 & CPU_FEATURE_MWAIT);
}
inline static uint32_t has_vmx(void) {
return (cpu_info.feature2 & CPU_FEATURE_VMX);
}
inline static uint32_t has_sse3(void) {
return (cpu_info.feature2 & CPU_FEATURE_SSE3);
}

View file

@ -349,7 +349,7 @@ int cpu_detection(void) {
a = b = c = d = 0;
cpuid(1, &a, &b, &cpu_info.feature2, &cpu_info.feature1);
kprintf("CPU features: %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
kprintf("CPU features: %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
has_sse() ? "SSE " : "",
has_sse2() ? "SSE2 " : "",
has_sse3() ? "SSE3 " : "",
@ -364,6 +364,7 @@ int cpu_detection(void) {
has_fxsr() ? "FXSR " : "",
has_xsave() ? "XSAVE " : "",
has_osxsave() ? "OSXSAVE " : "",
has_vmx() ? "VMX " : "",
has_rdtscp() ? "RDTSCP " : "",
has_fsgsbase() ? "FSGSBASE " : "",
has_mwait() ? "MWAIT " : "",