Commit 7803339f authored by Sean Christopherson's avatar Sean Christopherson
Browse files

KVM: selftests: Use data load to trigger LLC references/misses in Intel PMU

In the PMU counters test, add a data load in the measured loop and target
the data with CLFLUSH{OPT} in order to (try to) guarantee the loop
generates LLC misses and fills.  Per the SDM, some hardware prefetchers
are allowed to omit relevant PMU events, and Emerald Rapids (and possibly
Sapphire Rapids) appears to have gained an instruction prefetcher that
bypasses event counts.  E.g. the test will consistently fail on EMR CPUs,
but then pass with seemingly benign changes to the code.

  The event count includes speculation and cache line fills due to the
  first-level cache hardware prefetcher, but may exclude cache line fills
  due to other hardware-prefetchers.

Generate a data load as a last ditch effort to preserve the (minimal) test
coverage for LLC references and misses.

Cc: Maxim Levitsky <mlevitsk@redhat.com>
Link: https://lore.kernel.org/r/20241127235627.4049619-1-seanjc@google.com


Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
parent bd779107
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment