diff --git a/hypervisor/Makefile b/hypervisor/Makefile index 329480485..98988a8a1 100644 --- a/hypervisor/Makefile +++ b/hypervisor/Makefile @@ -78,7 +78,7 @@ CFLAGS += -ffunction-sections -fdata-sections CFLAGS += -fshort-wchar -ffreestanding CFLAGS += -fsigned-char CFLAGS += -m64 -mno-mmx -mno-sse -mno-sse2 -mno-80387 -mno-fp-ret-in-387 -CFLAGS += -mno-red-zone +CFLAGS += -mno-red-zone -mpopcnt CFLAGS += -nostdinc -nostdlib -fno-common CFLAGS += -Werror CFLAGS += -O2 diff --git a/hypervisor/arch/x86/cpu_caps.c b/hypervisor/arch/x86/cpu_caps.c index fc3bc4d80..8627a774b 100644 --- a/hypervisor/arch/x86/cpu_caps.c +++ b/hypervisor/arch/x86/cpu_caps.c @@ -423,6 +423,9 @@ int32_t detect_hardware_support(void) } else if (!pcpu_has_cap(X86_FEATURE_X2APIC)) { printf("%s, x2APIC not supported\n", __func__); ret = -ENODEV; + } else if (!pcpu_has_cap(X86_FEATURE_POPCNT)) { + printf("%s, popcnt instruction not supported\n", __func__); + ret = -ENODEV; } else { ret = check_vmx_mmu_cap(); }