[RFC PATCH 0/3] perf/x86/amd/uncore: Add common helpers and Hygon support

Qi Liu posted 3 patches 5 days, 23 hours ago
arch/x86/events/Kconfig             |  11 +
arch/x86/events/amd/Makefile        |   4 +-
arch/x86/events/amd/hygon_uncore.c  | 567 +++++++++++++++++++++++++++
arch/x86/events/amd/uncore.c        | 585 ++++------------------------
arch/x86/events/amd/uncore_common.c | 390 +++++++++++++++++++
arch/x86/events/amd/uncore_common.h | 113 ++++++
arch/x86/include/asm/msr-index.h    |   2 +
arch/x86/include/asm/perf_event.h   |  20 +
include/linux/cpuhotplug.h          |   3 +
9 files changed, 1184 insertions(+), 511 deletions(-)
create mode 100644 arch/x86/events/amd/hygon_uncore.c
create mode 100644 arch/x86/events/amd/uncore_common.c
create mode 100644 arch/x86/events/amd/uncore_common.h
[RFC PATCH 0/3] perf/x86/amd/uncore: Add common helpers and Hygon support
Posted by Qi Liu 5 days, 23 hours ago
This series adds initial Hygon uncore PMU support.

Hygon uncore PMUs use a programming model close to the AMD uncore PMU,
so this series factors out a small set of common helpers for perf event
handling, counter assignment and per-CPU context management.

The Hygon-specific support is kept in the Hygon driver. This RFC
currently includes support for the Hygon DF and DF IOD PMUs. No
Hygon-specific logic is added to the AMD driver.

There is also an Hygon L3 PMU patch currently under review:
https://lore.kernel.org/lkml/9a4731a46cc0a7645838bd848a40a6574a97bad6.1775548724.git.fuhao@open-hieco.net/
If the overall approach in this RFC looks acceptable, that support can
be rebased onto this common helper structure in follow-up patches.

This is an RFC. Comments on the helper boundaries and file placement
are welcome.

Qi Liu (3):
  perf/x86/amd/uncore: Add common PMU helper functions
  perf/x86/amd/uncore: Convert AMD driver to common PMU helpers
  perf/x86/amd/uncore: Add Hygon uncore PMU support

 arch/x86/events/Kconfig             |  11 +
 arch/x86/events/amd/Makefile        |   4 +-
 arch/x86/events/amd/hygon_uncore.c  | 567 +++++++++++++++++++++++++++
 arch/x86/events/amd/uncore.c        | 585 ++++------------------------
 arch/x86/events/amd/uncore_common.c | 390 +++++++++++++++++++
 arch/x86/events/amd/uncore_common.h | 113 ++++++
 arch/x86/include/asm/msr-index.h    |   2 +
 arch/x86/include/asm/perf_event.h   |  20 +
 include/linux/cpuhotplug.h          |   3 +
 9 files changed, 1184 insertions(+), 511 deletions(-)
 create mode 100644 arch/x86/events/amd/hygon_uncore.c
 create mode 100644 arch/x86/events/amd/uncore_common.c
 create mode 100644 arch/x86/events/amd/uncore_common.h

-- 
2.34.1