KVM: selftests: Print out failing MSR and value in vcpu_set_msr()
authorSean Christopherson <seanjc@google.com>
Sat, 11 Mar 2023 00:46:08 +0000 (16:46 -0800)
committerSean Christopherson <seanjc@google.com>
Thu, 6 Apr 2023 21:58:43 +0000 (14:58 -0700)
commit22234c2495eafd6b8f1f26c6c6adc12aca60fd7f
treea16fa866fd2a4a3210aa0798eafad4037c5dd9de
parentb1b705627cb3c23333e04637d7a90833b560584e
KVM: selftests: Print out failing MSR and value in vcpu_set_msr()

Reimplement vcpu_set_msr() as a macro and pretty print the failing MSR
(when possible) and the value if KVM_SET_MSRS fails instead of using the
using the standard KVM_IOCTL_ERROR().  KVM_SET_MSRS is somewhat odd in
that it returns the index of the last successful write, i.e. will be
'0' on failure barring an entirely different KVM bug.  And for writing
MSRs, the MSR being written and the value being written are almost always
relevant to the failure, i.e. just saying "failed!" doesn't help debug.

Place the string goo in a separate macro in anticipation of using it to
further expand MSR testing.

Link: https://lore.kernel.org/r/20230311004618.920745-12-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/include/x86_64/processor.h