[kvm-unit-test,nVMX] If "enable EPT" is enabled in a test, EPT pointer must also be set up
diff mbox series

Message ID 20190123064308.6868-2-krish.sadhukhan@oracle.com
State New
Headers show
Series
  • [kvm-unit-test,nVMX] If "enable EPT" is enabled in a test, EPT pointer must also be set up
Related show

Commit Message

Krish Sadhukhan Jan. 23, 2019, 6:43 a.m. UTC
Commit,

    5b8ba41dafd7 KVM: nVMX: move vmcs12 EPTP consistency check to
check_vmentry_prereqs()

moved the check for EPT pointer, from nested_ept_get_cr3() to
check_vmentry_prereqs(). As a result, if "enabled EPT" is set in a test
but EPT pointer is not, vmentry will fail even if EPT pointer is not
tested in that particular test.

Signed-off-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
Reviewed-by: Mark Kanda <mark.kanda@oracle.com>
---
 x86/vmx_tests.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Paolo Bonzini Jan. 25, 2019, 5:50 p.m. UTC | #1
On 23/01/19 07:43, Krish Sadhukhan wrote:
> Commit,
> 
>     5b8ba41dafd7 KVM: nVMX: move vmcs12 EPTP consistency check to
> check_vmentry_prereqs()
> 
> moved the check for EPT pointer, from nested_ept_get_cr3() to
> check_vmentry_prereqs(). As a result, if "enabled EPT" is set in a test
> but EPT pointer is not, vmentry will fail even if EPT pointer is not
> tested in that particular test.
> 
> Signed-off-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
> Reviewed-by: Mark Kanda <mark.kanda@oracle.com>
> ---
>  x86/vmx_tests.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c
> index ee0c9ff..1e987e6 100644
> --- a/x86/vmx_tests.c
> +++ b/x86/vmx_tests.c
> @@ -4682,6 +4682,7 @@ static void test_ept_eptp(void)
>  	report_prefix_pop();
>  
>  	secondary |= CPU_EPT;
> +	setup_ept(false);
>  	vmcs_write(CPU_EXEC_CTRL1, secondary);
>  	report_prefix_pushf("Enable-EPT enabled, unrestricted-guest enabled");
>  	test_vmx_controls(true, false);
> @@ -4737,6 +4738,7 @@ static void test_pml(void)
>  	report_prefix_pop();
>  
>  	secondary |= CPU_EPT;
> +	setup_ept(false);
>  	vmcs_write(CPU_EXEC_CTRL1, secondary);
>  	report_prefix_pushf("enable-PML enabled, enable-EPT enabled");
>  	test_vmx_controls(true, false);
> 

Queued, thanks.

Paolo

Patch
diff mbox series

diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c
index ee0c9ff..1e987e6 100644
--- a/x86/vmx_tests.c
+++ b/x86/vmx_tests.c
@@ -4682,6 +4682,7 @@  static void test_ept_eptp(void)
 	report_prefix_pop();
 
 	secondary |= CPU_EPT;
+	setup_ept(false);
 	vmcs_write(CPU_EXEC_CTRL1, secondary);
 	report_prefix_pushf("Enable-EPT enabled, unrestricted-guest enabled");
 	test_vmx_controls(true, false);
@@ -4737,6 +4738,7 @@  static void test_pml(void)
 	report_prefix_pop();
 
 	secondary |= CPU_EPT;
+	setup_ept(false);
 	vmcs_write(CPU_EXEC_CTRL1, secondary);
 	report_prefix_pushf("enable-PML enabled, enable-EPT enabled");
 	test_vmx_controls(true, false);