Commit 7d433b9f authored by Avi Kivity's avatar Avi Kivity

KVM: VMX: Make flexpriority module parameter reflect hardware capability

If the hardware does not support flexpriority, zero the module parameter.
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent 78646121
...@@ -237,9 +237,7 @@ static inline int cpu_has_secondary_exec_ctrls(void) ...@@ -237,9 +237,7 @@ static inline int cpu_has_secondary_exec_ctrls(void)
static inline bool cpu_has_vmx_virtualize_apic_accesses(void) static inline bool cpu_has_vmx_virtualize_apic_accesses(void)
{ {
return flexpriority_enabled return flexpriority_enabled;
&& (vmcs_config.cpu_based_2nd_exec_ctrl &
SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES);
} }
static inline int cpu_has_vmx_invept_individual_addr(void) static inline int cpu_has_vmx_invept_individual_addr(void)
...@@ -1203,6 +1201,9 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf) ...@@ -1203,6 +1201,9 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf)
if (!cpu_has_vmx_ept()) if (!cpu_has_vmx_ept())
enable_ept = 0; enable_ept = 0;
if (!(vmcs_config.cpu_based_2nd_exec_ctrl & SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES))
flexpriority_enabled = 0;
min = 0; min = 0;
#ifdef CONFIG_X86_64 #ifdef CONFIG_X86_64
min |= VM_EXIT_HOST_ADDR_SPACE_SIZE; min |= VM_EXIT_HOST_ADDR_SPACE_SIZE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment