KVM: VMX: Add module option to disable flexpriority
authorAvi Kivity <avi@qumranet.com>
Mon, 24 Mar 2008 16:15:14 +0000 (18:15 +0200)
committerAvi Kivity <avi@qumranet.com>
Sun, 27 Apr 2008 09:00:37 +0000 (12:00 +0300)
Useful for debugging.

Signed-off-by: Avi Kivity <avi@qumranet.com>
arch/x86/kvm/vmx.c

index fb0389d3a8d18b7e1da606a23c05c4593f8993a0..01559311df8ca63149d3b89864a6b83d2aab7cb6 100644 (file)
@@ -39,6 +39,9 @@ module_param(bypass_guest_pf, bool, 0);
 static int enable_vpid = 1;
 module_param(enable_vpid, bool, 0);
 
+static int flexpriority_enabled = 1;
+module_param(flexpriority_enabled, bool, 0);
+
 struct vmcs {
        u32 revision_id;
        u32 abort;
@@ -200,8 +203,9 @@ static inline int cpu_has_secondary_exec_ctrls(void)
 
 static inline bool cpu_has_vmx_virtualize_apic_accesses(void)
 {
-       return (vmcs_config.cpu_based_2nd_exec_ctrl &
-               SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES);
+       return flexpriority_enabled
+               && (vmcs_config.cpu_based_2nd_exec_ctrl &
+                   SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES);
 }
 
 static inline int vm_need_virtualize_apic_accesses(struct kvm *kvm)