diff mbox

[kvm-unit-tests,12/32] x86: test VMPTRLD does not drop VMWRITEs

Message ID 20170421005004.137260-13-dmatlack@google.com (mailing list archive)
State New, archived
Headers show

Commit Message

David Matlack April 21, 2017, 12:49 a.m. UTC
Signed-off-by: David Matlack <dmatlack@google.com>
---
 x86/vmx.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/x86/vmx.c b/x86/vmx.c
index fd1aa3bc6c2e..9ca37f63b636 100644
--- a/x86/vmx.c
+++ b/x86/vmx.c
@@ -257,7 +257,7 @@  static bool check_vmcs_field(struct vmcs_field *f, u8 cookie)
 	if (expected == actual)
 		return true;
 
-	printf("FAIL: VMWRITE/VMREAD %lx (expected: %lx, actual: %lx)",
+	printf("FAIL: VMWRITE/VMREAD %lx (expected: %lx, actual: %lx)\n",
 	       f->encoding, (unsigned long) expected, (unsigned long) actual);
 
 	return false;
@@ -349,6 +349,11 @@  void test_vmcs_lifecycle(void)
 	VMCLEAR(0);
 	report("current:VMCS1 active:[VCMS1]", check_all_vmcs_fields(1));
 
+	/* VMPTRLD should not erase VMWRITEs to the current VMCS */
+	set_all_vmcs_fields(2);
+	VMPTRLD(1);
+	report("current:VMCS1 active:[VCMS1]", check_all_vmcs_fields(2));
+
 	for (i = 0; i < ARRAY_SIZE(vmcs); i++) {
 		VMCLEAR(i);
 		free_page(vmcs[i]);