KVM: selftests: Extend PMU counters test to validate RDPMC after WRMSR
authorSean Christopherson <seanjc@google.com>
Tue, 9 Jan 2024 23:02:49 +0000 (15:02 -0800)
committerSean Christopherson <seanjc@google.com>
Tue, 30 Jan 2024 23:29:46 +0000 (15:29 -0800)
commita8a37f5556845b13be2df3d545e7245b574e0ff5
treeda45c1e72147404217729ca3dc418e2411607f8b
parentb5e66df34cb0de716859595ce7a4d9d1d015a695
KVM: selftests: Extend PMU counters test to validate RDPMC after WRMSR

Extend the read/write PMU counters subtest to verify that RDPMC also reads
back the written value.  Opportunsitically verify that attempting to use
the "fast" mode of RDPMC fails, as the "fast" flag is only supported by
non-architectural PMUs, which KVM doesn't virtualize.

Tested-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
Link: https://lore.kernel.org/r/20240109230250.424295-30-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/x86_64/pmu_counters_test.c