diff mbox

EPT support breakage on: KVM: VMX: Zero ept module parameter if ept is not present

Message ID 20090401020230.GA15680@syang10-desktop (mailing list archive)
State New, archived
Headers show

Commit Message

Sheng Yang April 1, 2009, 2:02 a.m. UTC
Oops... Thanks very much for reporting! I can't believe we haven't awared of
that...

Could you please try the attached patch? Thanks!

Comments

Andrew Theurer April 1, 2009, 8:26 p.m. UTC | #1
Sheng Yang wrote:
> Oops... Thanks very much for reporting! I can't believe we haven't awared of
> that...
>
> Could you please try the attached patch? Thanks!
>   
Tested and works great.  Thanks!

-Andrew
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index aba41ae..8d6465b 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -1195,15 +1195,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 (!(vmcs_config.cpu_based_2nd_exec_ctrl & SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES))
> -		flexpriority_enabled = 0;
> -
>  	min = 0;
>  #ifdef CONFIG_X86_64
>  	min |= VM_EXIT_HOST_ADDR_SPACE_SIZE;
> @@ -1307,6 +1298,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 (!(vmcs_config.cpu_based_2nd_exec_ctrl & SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES))
> +		flexpriority_enabled = 0;
> +
>  	return alloc_kvm_area();
>  }
>
>   

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index aba41ae..8d6465b 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -1195,15 +1195,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 (!(vmcs_config.cpu_based_2nd_exec_ctrl & SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES))
-		flexpriority_enabled = 0;
-
 	min = 0;
 #ifdef CONFIG_X86_64
 	min |= VM_EXIT_HOST_ADDR_SPACE_SIZE;
@@ -1307,6 +1298,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 (!(vmcs_config.cpu_based_2nd_exec_ctrl & SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES))
+		flexpriority_enabled = 0;
+
 	return alloc_kvm_area();
 }