diff options
author | Sean Christopherson <seanjc@google.com> | 2025-01-18 02:42:00 +0300 |
---|---|---|
committer | Sean Christopherson <seanjc@google.com> | 2025-02-12 19:34:56 +0300 |
commit | 8752e2b4a2b770932c3f99dcf626cb326b02d518 (patch) | |
tree | db0417f93adcda2314fb4f7c007b2a52e0502334 /tools/perf/scripts/python/task-analyzer.py | |
parent | 933178ddf73a031bfa9efa67452504ea3be43b18 (diff) | |
download | linux-8752e2b4a2b770932c3f99dcf626cb326b02d518.tar.xz |
KVM: selftests: Only validate counts for hardware-supported arch events
In the Intel PMU counters test, only validate the counts for architectural
events that are supported in hardware. If an arch event isn't supported,
the event selector may enable a completely different event, and thus the
logic for the expected count is bogus.
This fixes test failures on pre-Icelake systems due to the encoding for
the architectural Top-Down Slots event corresponding to something else
(at least on the Skylake family of CPUs).
Note, validation relies on *hardware* support, not KVM support and not
guest support. Architectural events are all about enumerating the event
selector encoding; lack of enumeration for an architectural event doesn't
mean the event itself is unsupported, i.e. the event should still count as
expected even if KVM and/or guest CPUID doesn't enumerate the event as
being "architectural".
Note #2, it's desirable to _program_ the architectural event encoding even
if hardware doesn't support the event. The count can't be validated when
the event is fully enabled, but KVM should still let the guest program the
event selector, and the PMC shouldn't count if the event is disabled.
Fixes: 4f1bd6b16074 ("KVM: selftests: Test Intel PMU architectural events on gp counters")
Reported-by: kernel test robot <oliver.sang@intel.com>
Closes: https://lore.kernel.org/oe-lkp/202501141009.30c629b4-lkp@intel.com
Debugged-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
Link: https://lore.kernel.org/r/20250117234204.2600624-3-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'tools/perf/scripts/python/task-analyzer.py')
0 files changed, 0 insertions, 0 deletions