KVM: selftests: Split PMU caps sub-tests to avoid writing MSR after KVM_RUN
authorSean Christopherson <seanjc@google.com>
Sat, 11 Mar 2023 00:46:02 +0000 (16:46 -0800)
committerSean Christopherson <seanjc@google.com>
Thu, 6 Apr 2023 21:57:23 +0000 (14:57 -0700)
commite4d86fb910dfdeb4320d5a7b9ebf6e81f10b1380
tree9d114501ec5b4c467f3030f855f9db15a2d57f12
parent9eb6ba31db27253a11441368d2801c1eedc48b4f
KVM: selftests: Split PMU caps sub-tests to avoid writing MSR after KVM_RUN

Split the PERF_CAPABILITIES subtests into two parts so that the LBR format
testcases don't execute after KVM_RUN.  Similar to the guest CPUID model,
KVM will soon disallow changing PERF_CAPABILITIES after KVM_RUN, at which
point attempting to set the MSR after KVM_RUN will yield false positives
and/or false negatives depending on what the test is trying to do.

Land the LBR format test in a more generic "immutable features" test in
anticipation of expanding its scope to other immutable features.

Link: https://lore.kernel.org/r/20230311004618.920745-6-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/x86_64/vmx_pmu_caps_test.c