KVM: selftests: Expand PMU counters test to verify LLC events
authorSean Christopherson <seanjc@google.com>
Tue, 9 Jan 2024 23:02:41 +0000 (15:02 -0800)
committerSean Christopherson <seanjc@google.com>
Tue, 30 Jan 2024 23:29:40 +0000 (15:29 -0800)
commitb55e7adf633a8a13d5ede57b77509ea8fa157a56
treeb1013dc83df8f3b509ddf1b413372db534a85ad0
parent787071fd02625151b94a2f93a47cdc9a25884633
KVM: selftests: Expand PMU counters test to verify LLC events

Expand the PMU counters test to verify that LLC references and misses have
non-zero counts when the code being executed while the LLC event(s) is
active is evicted via CFLUSH{,OPT}.  Note, CLFLUSH{,OPT} requires a fence
of some kind to ensure the cache lines are flushed before execution
continues.  Use MFENCE for simplicity (performance is not a concern).

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