diff mbox series

[kvm-unit-test,2/2] nVMX: Move all tests for VM-entry control fields to a separate function

Message ID 20181207182637.13043-3-krish.sadhukhan@oracle.com (mailing list archive)
State New, archived
Headers show
Series [kvm-unit-test,1/2] nVMX: Move all tests for VM-execution control fields to a separate function | expand

Commit Message

Krish Sadhukhan Dec. 7, 2018, 6:26 p.m. UTC
... to improve readability and maintainability, and to align the code as per
the layout of the checks in chapter "VM Entries" in Intel SDM vol 3C.

Signed-off-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
Reviewed-by: Mihai Carabas <mihai.carabas@oracle.com>
---
 x86/vmx_tests.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c
index 50806ab..2ff94e0 100644
--- a/x86/vmx_tests.c
+++ b/x86/vmx_tests.c
@@ -4819,6 +4819,14 @@  static void test_vm_execution_ctls(void)
 }
 
 /*
+ * Tests for VM-entry control fields
+ */
+static void test_vm_entry_ctls(void)
+{
+	test_invalid_event_injection();
+}
+
+/*
  * Check that the virtual CPU checks all of the VMX controls as
  * documented in the Intel SDM.
  */
@@ -4832,7 +4840,7 @@  static void vmx_controls_test(void)
 	vmcs_write(GUEST_RFLAGS, 0);
 
 	test_vm_execution_ctls();
-	test_invalid_event_injection();
+	test_vm_entry_ctls();
 }
 
 static bool valid_vmcs_for_vmentry(void)