diff options
author | Avi Kivity <avi@redhat.com> | 2009-03-24 08:27:47 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-06-10 04:48:34 -0400 |
commit | 7d433b9f942606f66da8ef68b8baecd2915c5627 (patch) | |
tree | aea63fedbaafd13d886af28445bb4f6721b9e8d6 /arch | |
parent | 78646121e9a2fcf7977cc15966420e572a450bc3 (diff) |
KVM: VMX: Make flexpriority module parameter reflect hardware capability
If the hardware does not support flexpriority, zero the module parameter.
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kvm/vmx.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index b9e06b07aca1..37ae13d7b814 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -237,9 +237,7 @@ static inline int cpu_has_secondary_exec_ctrls(void) | |||
237 | 237 | ||
238 | static inline bool cpu_has_vmx_virtualize_apic_accesses(void) | 238 | static inline bool cpu_has_vmx_virtualize_apic_accesses(void) |
239 | { | 239 | { |
240 | return flexpriority_enabled | 240 | return flexpriority_enabled; |
241 | && (vmcs_config.cpu_based_2nd_exec_ctrl & | ||
242 | SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES); | ||
243 | } | 241 | } |
244 | 242 | ||
245 | static inline int cpu_has_vmx_invept_individual_addr(void) | 243 | 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 | if (!cpu_has_vmx_ept()) | 1201 | if (!cpu_has_vmx_ept()) |
1204 | enable_ept = 0; | 1202 | enable_ept = 0; |
1205 | 1203 | ||
1204 | if (!(vmcs_config.cpu_based_2nd_exec_ctrl & SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES)) | ||
1205 | flexpriority_enabled = 0; | ||
1206 | |||
1206 | min = 0; | 1207 | min = 0; |
1207 | #ifdef CONFIG_X86_64 | 1208 | #ifdef CONFIG_X86_64 |
1208 | min |= VM_EXIT_HOST_ADDR_SPACE_SIZE; | 1209 | min |= VM_EXIT_HOST_ADDR_SPACE_SIZE; |