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

Message ID 20190122193629.5937-1-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. 22, 2019, 7:36 p.m. UTC
Commit 2737c0410fa60eeaef8a7af0f8968be40cb1e9d9 move 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 being tested in that particular test.

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

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