KVM: selftests: Fix broken assert messages in Hyper-V features test
Swap the ordering of parameters to guest asserts related to {RD,WR}MSR
success/failure in the Hyper-V features test. As is, the output will
be mangled and broken due to passing an integer as a string and vice
versa.
Opportunistically fix a benign %u vs. %lu issue as well.
Link: https://lore.kernel.org/r/20231129224916.532431-4-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
This commit is contained in:
@@ -55,11 +55,11 @@ static void guest_msr(struct msr_data *msr)
|
||||
if (msr->fault_expected)
|
||||
__GUEST_ASSERT(vector == GP_VECTOR,
|
||||
"Expected #GP on %sMSR(0x%x), got vector '0x%x'",
|
||||
msr->idx, msr->write ? "WR" : "RD", vector);
|
||||
msr->write ? "WR" : "RD", msr->idx, vector);
|
||||
else
|
||||
__GUEST_ASSERT(!vector,
|
||||
"Expected success on %sMSR(0x%x), got vector '0x%x'",
|
||||
msr->idx, msr->write ? "WR" : "RD", vector);
|
||||
msr->write ? "WR" : "RD", msr->idx, vector);
|
||||
|
||||
if (vector || is_write_only_msr(msr->idx))
|
||||
goto done;
|
||||
@@ -102,11 +102,11 @@ static void guest_hcall(vm_vaddr_t pgs_gpa, struct hcall_data *hcall)
|
||||
vector = __hyperv_hypercall(hcall->control, input, output, &res);
|
||||
if (hcall->ud_expected) {
|
||||
__GUEST_ASSERT(vector == UD_VECTOR,
|
||||
"Expected #UD for control '%u', got vector '0x%x'",
|
||||
"Expected #UD for control '%lu', got vector '0x%x'",
|
||||
hcall->control, vector);
|
||||
} else {
|
||||
__GUEST_ASSERT(!vector,
|
||||
"Expected no exception for control '%u', got vector '0x%x'",
|
||||
"Expected no exception for control '%lu', got vector '0x%x'",
|
||||
hcall->control, vector);
|
||||
GUEST_ASSERT_EQ(res, hcall->expect);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user