@@ -5007,13 +5007,14 @@ static void guest_state_test_main(void)
asm volatile("fnop");
}
-static void report_guest_pat_test(const char *test, u32 xreason, u64 guest_pat)
+static void report_guest_state_test(const char *test, u32 xreason,
+ u64 field, const char * field_name)
{
u32 reason = vmcs_read(EXI_REASON);
u64 guest_rip;
u32 insn_len;
- report("%s, GUEST_PAT %lx", reason == xreason, test, guest_pat);
+ report("%s, %s %lx", reason == xreason, test, field_name, field);
guest_rip = vmcs_read(GUEST_RIP);
insn_len = vmcs_read(EXI_INST_LEN);
@@ -5112,8 +5113,9 @@ static void test_pat(u32 fld, const char * fld_name, u32 ctrl_fld, u64 ctrl_bit)
} else { // GUEST_PAT
__enter_guest(ABORT_ON_EARLY_VMENTRY_FAIL);
- report_guest_pat_test("ENT_LOAD_PAT enabled",
- VMX_VMCALL, val);
+ report_guest_state_test("ENT_LOAD_PAT enabled",
+ VMX_VMCALL, val,
+ "GUEST_PAT");
}
}
}
@@ -5139,17 +5141,19 @@ static void test_pat(u32 fld, const char * fld_name, u32 ctrl_fld, u64 ctrl_bit)
} else { // GUEST_PAT
if (i == 0x2 || i == 0x3 || i == 0x8) {
__enter_guest(ABORT_ON_EARLY_VMENTRY_FAIL);
- report_guest_pat_test("ENT_LOAD_PAT "
- "enabled",
+ report_guest_state_test("ENT_LOAD_PAT "
+ "enabled",
VMX_FAIL_STATE |
VMX_ENTRY_FAILURE,
- val);
+ val,
+ "GUEST_PAT");
} else {
__enter_guest(ABORT_ON_EARLY_VMENTRY_FAIL);
- report_guest_pat_test("ENT_LOAD_PAT "
+ report_guest_state_test("ENT_LOAD_PAT "
"enabled",
VMX_VMCALL,
- val);
+ val,
+ "GUEST_PAT");
}
}