Skip to content

Commit

Permalink
KVM: VMX: Zero ept module parameter if ept is not present
Browse files Browse the repository at this point in the history
Allows reading back hardware capability.

Signed-off-by: Avi Kivity <avi@redhat.com>
  • Loading branch information
Avi Kivity committed Jun 10, 2009
1 parent 919818a commit 575ff2d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion arch/x86/kvm/vmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ static inline int cpu_has_vmx_ept(void)

static inline int vm_need_ept(void)
{
return (cpu_has_vmx_ept() && enable_ept);
return enable_ept;
}

static inline int vm_need_virtualize_apic_accesses(struct kvm *kvm)
Expand Down Expand Up @@ -1205,6 +1205,9 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf)
if (!cpu_has_vmx_vpid())
enable_vpid = 0;

if (!cpu_has_vmx_ept())
enable_ept = 0;

min = 0;
#ifdef CONFIG_X86_64
min |= VM_EXIT_HOST_ADDR_SPACE_SIZE;
Expand Down

0 comments on commit 575ff2d

Please sign in to comment.