The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 0/3] perf/x86: Fix perf_event_print_debug() on non-Intel PMUs
@ 2026-08-06 10:03 Sandipan Das
  2026-08-06 10:03 ` [PATCH 1/3] perf/x86: Add x86_pmu::print_debug Sandipan Das
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Sandipan Das @ 2026-08-06 10:03 UTC (permalink / raw)
  To: linux-perf-users, linux-kernel
  Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Ian Rogers, Adrian Hunter, James Clark, Thomas Gleixner,
	Borislav Petkov, Dave Hansen, x86, H . Peter Anvin, Petr Tesarik,
	Ravi Bangoria, Ananth Narayan, Sandipan Das

Petr Tesarik reported that reading MSR_ARCH_PERFMON_FIXED_CTR_CTRL
raises a #GP on AMD processors that support PerfMonV2, and proposed
skipping that register when no fixed counters are implemented [1].

However, perf_event_print_debug() also dumps the global control and
status registers whenever x86_pmu.version >= 2, and reads Intel
Architectural PerfMon MSRs to do so. That condition used to be
Intel-specific, but since commit 21d59e3e2c40 ("perf/x86/amd/core:
Detect PerfMonV2 support"), x86_pmu.version is also set to 2 on AMD
processors that support PerfMonV2, where none of those registers are
available.

The same reasoning therefore applies to the other registers read here,
so rather than special-casing each one or reinstating a vendor check,
this series makes the global register dump a vendor-specific operation.

[1] https://lore.kernel.org/all/20260717150315.2868314-1-ptesarik@suse.com/

Sandipan Das (3):
  perf/x86: Add x86_pmu::print_debug
  perf/x86: Move MSR_CORE_PERF_GLOBAL_* dump to vendor code
  perf/x86/amd: Implement x86_pmu::print_debug

 arch/x86/events/amd/core.c     | 20 ++++++++++++
 arch/x86/events/core.c         | 56 +++++++++++++++-------------------
 arch/x86/events/intel/core.c   | 32 +++++++++++++++++++
 arch/x86/events/perf_event.h   |  4 +++
 arch/x86/events/zhaoxin/core.c | 18 +++++++++++
 5 files changed, 98 insertions(+), 32 deletions(-)

-- 
2.53.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-08-06 15:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-06 10:03 [PATCH 0/3] perf/x86: Fix perf_event_print_debug() on non-Intel PMUs Sandipan Das
2026-08-06 10:03 ` [PATCH 1/3] perf/x86: Add x86_pmu::print_debug Sandipan Das
2026-08-06 10:03 ` [PATCH 2/3] perf/x86: Move MSR_CORE_PERF_GLOBAL_* dump to vendor code Sandipan Das
2026-08-06 10:03 ` [PATCH 3/3] perf/x86/amd: Implement x86_pmu::print_debug Sandipan Das
2026-08-06 15:44   ` Petr Tesarik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox