Skip to content

Commit 2e4a759

Browse files
vittyvkbonzini
authored andcommitted
KVM: selftests: x86: clarify what is reported on KVM_GET_MSRS failure
When KVM_GET_MSRS fail the report looks like ==== Test Assertion Failure ==== lib/x86_64/processor.c:1089: r == nmsrs pid=28775 tid=28775 - Argument list too long 1 0x000000000040a55f: vcpu_save_state at processor.c:1088 (discriminator 3) 2 0x00000000004010e3: main at state_test.c:171 (discriminator 4) 3 0x00007fb8e69223d4: ?? ??:0 4 0x0000000000401287: _start at ??:? Unexpected result from KVM_GET_MSRS, r: 36 (failed at 194) and it's not obvious that '194' here is the failed MSR index and that it's printed in hex. Change that. Suggested-by: Sean Christopherson <[email protected]> Signed-off-by: Vitaly Kuznetsov <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 19a36d3 commit 2e4a759

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/testing/selftests/kvm/lib/x86_64/processor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1085,7 +1085,7 @@ struct kvm_x86_state *vcpu_save_state(struct kvm_vm *vm, uint32_t vcpuid)
10851085
for (i = 0; i < nmsrs; i++)
10861086
state->msrs.entries[i].index = list->indices[i];
10871087
r = ioctl(vcpu->fd, KVM_GET_MSRS, &state->msrs);
1088-
TEST_ASSERT(r == nmsrs, "Unexpected result from KVM_GET_MSRS, r: %i (failed at %x)",
1088+
TEST_ASSERT(r == nmsrs, "Unexpected result from KVM_GET_MSRS, r: %i (failed MSR was 0x%x)",
10891089
r, r == nmsrs ? -1 : list->indices[r]);
10901090

10911091
r = ioctl(vcpu->fd, KVM_GET_DEBUGREGS, &state->debugregs);

0 commit comments

Comments
 (0)