If the hardware does not support flexpriority, zero the module parameter.
Signed-off-by: Avi Kivity <avi@redhat.com>
static inline bool cpu_has_vmx_virtualize_apic_accesses(void)
{
- return flexpriority_enabled
- && (vmcs_config.cpu_based_2nd_exec_ctrl &
- SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES);
+ return flexpriority_enabled;
}
static inline int cpu_has_vmx_invept_individual_addr(void)
if (!cpu_has_vmx_ept())
enable_ept = 0;
+ if (!(vmcs_config.cpu_based_2nd_exec_ctrl & SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES))
+ flexpriority_enabled = 0;
+
min = 0;
#ifdef CONFIG_X86_64
min |= VM_EXIT_HOST_ADDR_SPACE_SIZE;