Skip to content

Commit

Permalink
KVM: VMX: Fix feature testing
Browse files Browse the repository at this point in the history
The testing of feature is too early now, before vmcs_config complete initialization.

Signed-off-by: Sheng Yang <sheng@linux.intel.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
  • Loading branch information
Sheng Yang authored and Avi Kivity committed Jun 10, 2009
1 parent 0454715 commit 93ba03c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions arch/x86/kvm/vmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1208,15 +1208,6 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf)
vmx_capability.ept, vmx_capability.vpid);
}

if (!cpu_has_vmx_vpid())
enable_vpid = 0;

if (!cpu_has_vmx_ept())
enable_ept = 0;

if (!cpu_has_vmx_flexpriority())
flexpriority_enabled = 0;

min = 0;
#ifdef CONFIG_X86_64
min |= VM_EXIT_HOST_ADDR_SPACE_SIZE;
Expand Down Expand Up @@ -1320,6 +1311,15 @@ static __init int hardware_setup(void)
if (boot_cpu_has(X86_FEATURE_NX))
kvm_enable_efer_bits(EFER_NX);

if (!cpu_has_vmx_vpid())
enable_vpid = 0;

if (!cpu_has_vmx_ept())
enable_ept = 0;

if (!cpu_has_vmx_flexpriority())
flexpriority_enabled = 0;

return alloc_kvm_area();
}

Expand Down

0 comments on commit 93ba03c

Please sign in to comment.