KVM: selftests: Cache list of MSRs to save/restore
authorSean Christopherson <seanjc@google.com>
Thu, 2 Jun 2022 21:12:14 +0000 (14:12 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 11 Jun 2022 15:46:26 +0000 (11:46 -0400)
commitc095cb609b3aa56fd24e2907556c24fef88b9180
tree302412dddbf177e6971e62e46dd053af17150b2d
parenta12c86c447f4bce6d2725c3fab426aba6630b376
KVM: selftests: Cache list of MSRs to save/restore

Cache the list of MSRs to save restore, mostly to justify not freeing the
list in the caller, which simplifies consumption of the list.

Opportunistically move the XSS test's so called is_supported_msr() to
common code as kvm_msr_is_in_save_restore_list().  The XSS is "supported"
by KVM, it's simply not in the save/restore list because KVM doesn't yet
allow a non-zero value.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/include/x86_64/processor.h
tools/testing/selftests/kvm/lib/x86_64/processor.c
tools/testing/selftests/kvm/x86_64/xss_msr_test.c