* [PATCH] KVM: selftests: x86: clarify what is reported on KVM_GET_MSRS failure
@ 2019-09-27 15:54 Vitaly Kuznetsov
2019-09-27 16:01 ` Jim Mattson
2019-09-27 16:06 ` Paolo Bonzini
0 siblings, 2 replies; 3+ messages in thread
From: Vitaly Kuznetsov @ 2019-09-27 15:54 UTC (permalink / raw)
To: kvm
Cc: linux-kernel, Paolo Bonzini, Radim Krčmář,
Sean Christopherson, Jim Mattson
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 <sean.j.christopherson@intel.com>
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
tools/testing/selftests/kvm/lib/x86_64/processor.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/kvm/lib/x86_64/processor.c b/tools/testing/selftests/kvm/lib/x86_64/processor.c
index c53dbc6bc568..6698cb741e10 100644
--- a/tools/testing/selftests/kvm/lib/x86_64/processor.c
+++ b/tools/testing/selftests/kvm/lib/x86_64/processor.c
@@ -1085,7 +1085,7 @@ struct kvm_x86_state *vcpu_save_state(struct kvm_vm *vm, uint32_t vcpuid)
for (i = 0; i < nmsrs; i++)
state->msrs.entries[i].index = list->indices[i];
r = ioctl(vcpu->fd, KVM_GET_MSRS, &state->msrs);
- TEST_ASSERT(r == nmsrs, "Unexpected result from KVM_GET_MSRS, r: %i (failed at %x)",
+ TEST_ASSERT(r == nmsrs, "Unexpected result from KVM_GET_MSRS, r: %i (failed MSR was 0x%x)",
r, r == nmsrs ? -1 : list->indices[r]);
r = ioctl(vcpu->fd, KVM_GET_DEBUGREGS, &state->debugregs);
--
2.20.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] KVM: selftests: x86: clarify what is reported on KVM_GET_MSRS failure
2019-09-27 15:54 [PATCH] KVM: selftests: x86: clarify what is reported on KVM_GET_MSRS failure Vitaly Kuznetsov
@ 2019-09-27 16:01 ` Jim Mattson
2019-09-27 16:06 ` Paolo Bonzini
1 sibling, 0 replies; 3+ messages in thread
From: Jim Mattson @ 2019-09-27 16:01 UTC (permalink / raw)
To: Vitaly Kuznetsov
Cc: kvm list, LKML, Paolo Bonzini, Radim Krčmář,
Sean Christopherson
On Fri, Sep 27, 2019 at 8:54 AM Vitaly Kuznetsov <vkuznets@redhat.com> wrote:
>
> 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 <sean.j.christopherson@intel.com>
> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Reviewed-by: Jim Mattson <jmattson@google.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] KVM: selftests: x86: clarify what is reported on KVM_GET_MSRS failure
2019-09-27 15:54 [PATCH] KVM: selftests: x86: clarify what is reported on KVM_GET_MSRS failure Vitaly Kuznetsov
2019-09-27 16:01 ` Jim Mattson
@ 2019-09-27 16:06 ` Paolo Bonzini
1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2019-09-27 16:06 UTC (permalink / raw)
To: Vitaly Kuznetsov, kvm
Cc: linux-kernel, Radim Krčmář,
Sean Christopherson, Jim Mattson
On 27/09/19 17:54, Vitaly Kuznetsov wrote:
> 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 <sean.j.christopherson@intel.com>
> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
> ---
> tools/testing/selftests/kvm/lib/x86_64/processor.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/kvm/lib/x86_64/processor.c b/tools/testing/selftests/kvm/lib/x86_64/processor.c
> index c53dbc6bc568..6698cb741e10 100644
> --- a/tools/testing/selftests/kvm/lib/x86_64/processor.c
> +++ b/tools/testing/selftests/kvm/lib/x86_64/processor.c
> @@ -1085,7 +1085,7 @@ struct kvm_x86_state *vcpu_save_state(struct kvm_vm *vm, uint32_t vcpuid)
> for (i = 0; i < nmsrs; i++)
> state->msrs.entries[i].index = list->indices[i];
> r = ioctl(vcpu->fd, KVM_GET_MSRS, &state->msrs);
> - TEST_ASSERT(r == nmsrs, "Unexpected result from KVM_GET_MSRS, r: %i (failed at %x)",
> + TEST_ASSERT(r == nmsrs, "Unexpected result from KVM_GET_MSRS, r: %i (failed MSR was 0x%x)",
> r, r == nmsrs ? -1 : list->indices[r]);
>
> r = ioctl(vcpu->fd, KVM_GET_DEBUGREGS, &state->debugregs);
>
Queued, thanks.
Paolo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-09-27 16:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-27 15:54 [PATCH] KVM: selftests: x86: clarify what is reported on KVM_GET_MSRS failure Vitaly Kuznetsov
2019-09-27 16:01 ` Jim Mattson
2019-09-27 16:06 ` Paolo Bonzini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome