@@ -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]);
Signed-off-by: David Matlack <dmatlack@google.com> --- x86/vmx.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)