Skip to content

perf, x86: Add northbridge counter support for AMD family 15h

Robert Richter lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest10 patches 15 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10perf, amd: Rework northbridge event constraints handlerarch/x86/kernel/cpu/perf_event_amd.c+26 -420 replies
2/10perf, x86: Rework counter reservation codearch/x86/kernel/cpu/perf_event.c+11 -140 replies
3/10perf, x86: Use bitmasks for generic countersarch/x86/kernel/cpu/perf_event.c arch/x86/kernel/cpu/perf_event.h arch/x86/kernel/cpu/perf_event_amd.c +2 more+42 -220 replies
4/10perf, x86: Rename Intel specific macrosarch/x86/include/asm/kvm_host.h arch/x86/include/asm/perf_event.h arch/x86/kernel/cpu/perf_event.c +4 more+49 -500 replies
5/10perf, x86: Move Intel specific code to intel_pmu_init()arch/x86/kernel/cpu/perf_event.c arch/x86/kernel/cpu/perf_event_intel.c+44 -342 replies
6/10perf, amd: Unify AMD's generic and family 15h pmusarch/x86/include/asm/perf_event.h arch/x86/kernel/cpu/perf_event_amd.c arch/x86/oprofile/op_model_amd.c+50 -610 replies
7/10perf, amd: Generalize northbridge constraints code for family 15harch/x86/kernel/cpu/perf_event_amd.c+40 -190 replies
8/10perf, amd: Enable northbridge counters on family 15harch/x86/include/asm/cpufeature.h arch/x86/include/asm/perf_event.h arch/x86/kernel/cpu/perf_event.c +1 more+58 -100 replies
9/10perf, x86: Improve debug output in check_hw_exists()arch/x86/kernel/cpu/perf_event.c+2 -10 replies
10/10perf, amd: Check northbridge event config valuearch/x86/include/asm/perf_event.h arch/x86/kernel/cpu/perf_event_amd.c+68 -280 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/10] perf, x86: Add northbridge counter support for AMD family 15h

This patch adds northbridge counter support for AMD family 15h cpus.

The NB counter implementation and usage is in the same way as for family 10h. Thus a nb event can now be selected as any other performance counter event. As for family 10h the kernel selects only one NB PMC per node by using the nb constraint handler.

Main part of this patch set is to rework current code in a way that bit masks for counters can be used. Also, Intel's fixed counters have been moved to Intel only code. This is since AMD nb counters start at index 32 which leads to holes in the counter mask and causes conflicts with fixed counters.

Another major change is the unification of AMD pmus and, where possible, a family independent feature check based on cpuid.

It should also be mentioned that nb perfctrs do not support all bits in the config value, see patch #10.

-Robert

Robert Richter (10):
perf, amd: Rework northbridge event constraints handler perf, x86: Rework counter reservation code
perf, x86: Use bitmasks for generic counters
perf, x86: Rename Intel specific macros
perf, x86: Move Intel specific code to intel_pmu_init() perf, amd: Unify AMD's generic and family 15h pmus perf, amd: Generalize northbridge constraints code for family 15h perf, amd: Enable northbridge counters on family 15h perf, x86: Improve debug output in check_hw_exists() perf, amd: Check northbridge event config value

 arch/x86/include/asm/cpufeature.h         |    2 +
 arch/x86/include/asm/kvm_host.h           |    4 +-
 arch/x86/include/asm/perf_event.h         |   26 ++-
 arch/x86/kernel/cpu/perf_event.c          |  129 +++++------
 arch/x86/kernel/cpu/perf_event.h          |    7 +
 arch/x86/kernel/cpu/perf_event_amd.c      |  368 +++++++++++++++++------------
 arch/x86/kernel/cpu/perf_event_intel.c    |   65 +++++-
 arch/x86/kernel/cpu/perf_event_intel_ds.c |    4 +-
 arch/x86/kernel/cpu/perf_event_p4.c       |    8 +-
 arch/x86/kvm/pmu.c                        |   22 +-
 arch/x86/oprofile/op_model_amd.c          |    4 +-
 11 files changed, 374 insertions(+), 265 deletions(-)
Signature · 1 line
1.7.8.4