diff options
| author | Dapeng Mi <dapeng1.mi@linux.intel.com> | 2026-07-17 16:03:39 +0800 |
|---|---|---|
| committer | Peter Zijlstra <peterz@infradead.org> | 2026-08-10 15:05:48 +0200 |
| commit | 3ba87c5bf11bea80e56abe17730085bc962ecfbe (patch) | |
| tree | ac298bdbfa4a5d993fc3835ee14aa962e3dae620 /tools/perf/scripts/python/task-analyzer.py | |
| parent | 85182f902afda28ca7ae3408b72f31640a5cfc73 (diff) | |
perf/x86: Remove stale fixed counter helper and fix hybrid PMU access
On hybrid systems, init_hw_perf_events() can call check_hw_exists() with
the global PMU pointer after perf_is_hybrid is set. In that case,
fixed_counter_disabled() uses hybrid() on a non-hybrid PMU object, so the
intel_ctrl access is taken from the wrong layout and can read out of
bounds.
fixed_counter_disabled() was added in commit 32451614da2a
("perf/x86/intel: Support CPUID 10.ECX to disable fixed counters"), when
fixed counters were tracked via num_fixed_counters. Today fixed counters
are represented by fixed_cntr_mask, so this helper is obsolete.
Remove fixed_counter_disabled() and its callers, and rely directly on the
fixed-counter bitmask. With the helper gone, check_hw_exists() no longer
needs a PMU argument, so drop that parameter as well. This removes the
invalid hybrid access and closes the out-of-bounds read risk.
Signed-off-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Thomas Falcon <thomas.falcon@intel.com>
Reviewed-by: Zide Chen <zide.chen@intel.com>
Link: https://patch.msgid.link/20260717080342.1879573-6-dapeng1.mi@linux.intel.com
Diffstat (limited to 'tools/perf/scripts/python/task-analyzer.py')
0 files changed, 0 insertions, 0 deletions
