All of lore.kernel.org
 help / color / mirror / Atom feed
* EPT support breakage on:  KVM: VMX: Zero ept module parameter if ept is not present
@ 2009-03-31 15:00 Andrew Theurer
  2009-04-01  2:02 ` Sheng Yang
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Theurer @ 2009-03-31 15:00 UTC (permalink / raw)
  To: kvm

I cannot get EPT support to work on commit:
21f65ab2c582594a69dcb1484afa9f88b3414b4f
KVM: VMX: Zero ept module parameter if ept is not present

I see tons of pf_guest from kvm_stat, where as the previous commit has none.
I am using "ept=1" module option for kvm-intel.

This is on Nehalem processors.

-Andrew


commit diff:

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 8b1b9b8..96a19f8 100644 (file)
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -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)
@@ -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;


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: EPT support breakage on:  KVM: VMX: Zero ept module parameter if ept is not present
  2009-03-31 15:00 EPT support breakage on: KVM: VMX: Zero ept module parameter if ept is not present Andrew Theurer
@ 2009-04-01  2:02 ` Sheng Yang
  2009-04-01 20:26   ` Andrew Theurer
  0 siblings, 1 reply; 3+ messages in thread
From: Sheng Yang @ 2009-04-01  2:02 UTC (permalink / raw)
  To: Andrew Theurer; +Cc: kvm, Avi Kivity

Oops... Thanks very much for reporting! I can't believe we haven't awared of
that...

Could you please try the attached patch? Thanks!

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();
 }
 
-- 
regards
Yang, Sheng

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: EPT support breakage on:  KVM: VMX: Zero ept module parameter if ept is not present
  2009-04-01  2:02 ` Sheng Yang
@ 2009-04-01 20:26   ` Andrew Theurer
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Theurer @ 2009-04-01 20:26 UTC (permalink / raw)
  To: Sheng Yang; +Cc: kvm, Avi Kivity

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();
>  }
>
>   


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-04-01 20:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-31 15:00 EPT support breakage on: KVM: VMX: Zero ept module parameter if ept is not present Andrew Theurer
2009-04-01  2:02 ` Sheng Yang
2009-04-01 20:26   ` Andrew Theurer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.