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

add check if the macro KVM_CAP_X2APIC_API is defined

This commit is contained in:
Stefan Lankes 2017-04-24 00:12:02 +02:00
parent 6a0331ab26
commit cb5787256d

View file

@ -1098,6 +1098,7 @@ int uhyve_init(char *path)
kvm_ioctl(vmfd, KVM_CREATE_IRQCHIP, NULL);
#ifdef KVM_CAP_X2APIC_API
// enable x2APIC support
struct kvm_enable_cap cap = {
.cap = KVM_CAP_X2APIC_API,
@ -1105,7 +1106,7 @@ int uhyve_init(char *path)
.args[0] = KVM_X2APIC_API_USE_32BIT_IDS|KVM_X2APIC_API_DISABLE_BROADCAST_QUIRK,
};
kvm_ioctl(vmfd, KVM_ENABLE_CAP, &cap);
#endif
// try to detect KVM extensions
tsc_deadline = kvm_ioctl(vmfd, KVM_CHECK_EXTENSION, KVM_CAP_TSC_DEADLINE_TIMER) <= 0 ? false : true;