linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/12] arm64: Add support for Armv9.4 PMU fixed instruction counter
@ 2024-06-26 22:32 Rob Herring (Arm)
  2024-06-26 22:32 ` [PATCH v2 01/12] perf: arm_pmuv3: Avoid assigning fixed cycle counter with threshold Rob Herring (Arm)
                   ` (12 more replies)
  0 siblings, 13 replies; 29+ messages in thread
From: Rob Herring (Arm) @ 2024-06-26 22:32 UTC (permalink / raw)
  To: Russell King, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Namhyung Kim, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Ian Rogers, Adrian Hunter,
	Will Deacon, Marc Zyngier, Oliver Upton, James Morse,
	Suzuki K Poulose, Zenghui Yu, Catalin Marinas, James Clark
  Cc: linux-arm-kernel, linux-kernel, linux-perf-users, kvmarm

This series adds support for the optional fixed instruction counter 
added in Armv9.4 PMU. Most of the series is a refactoring to remove the 
index to counter number conversion which dates back to the Armv7 PMU 
driver. Removing it is necessary in order to support more than 32 
counters without a bunch of conditional code further complicating the 
conversion.

Patches 1-2 are a fix and cleanup for the threshold support. Patch 1 is 
a dependency of patch 12.

Patches 3-4 move the 32-bit Arm PMU drivers into drivers/perf/ and drop 
non-DT probe support. These can be taken first if there's no comments on 
them.

Patch 5 is new to v2 and implements the common pattern of the linux/ 
header including the asm/ header of the same name.

Patch 6 changes struct arm_pmu.num_events to a bitmap of events, and 
updates all the users. This removes the index to counter conversion 
on the PMUv3 and Armv7 drivers.

Patch 7 updates various register accessors to use 64-bit values matching 
the register size.

Patches 8-9 update KVM PMU register accesses to use shared accessors 
from asm/arm_pmuv3.h.

Patches 10-11 rework KVM and perf PMU defines for counter indexes and 
number of counters.

Patch 12 finally adds support for the fixed instruction counter.

I tested this on FVP with VHE host and a guest. I tested the Armv7 PMU 
changes with QEMU.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
---
Changes in v2:
- Include threshold fix patches and account for threshold support in 
  counter assignment.
- Add patch including asm/arm_pmuv3.h from linux/perf/arm_pmuv3.h
- Fix compile error for Apple PMU
- Minor review comments detailed in individual patches
- Link to v1: https://lore.kernel.org/r/20240607-arm-pmu-3-9-icntr-v1-0-c7bd2dceff3b@kernel.org

---
Rob Herring (Arm) (12):
      perf: arm_pmuv3: Avoid assigning fixed cycle counter with threshold
      perf: arm_pmuv3: Drop unnecessary IS_ENABLED(CONFIG_ARM64) check
      perf/arm: Move 32-bit PMU drivers to drivers/perf/
      perf: arm_v6/7_pmu: Drop non-DT probe support
      perf: arm_pmuv3: Include asm/arm_pmuv3.h from linux/perf/arm_pmuv3.h
      perf: arm_pmu: Remove event index to counter remapping
      perf: arm_pmuv3: Prepare for more than 32 counters
      KVM: arm64: pmu: Use arm_pmuv3.h register accessors
      KVM: arm64: pmu: Use generated define for PMSELR_EL0.SEL access
      arm64: perf/kvm: Use a common PMU cycle counter define
      KVM: arm64: Refine PMU defines for number of counters
      perf: arm_pmuv3: Add support for Armv9.4 PMU instruction counter

 arch/arm/include/asm/arm_pmuv3.h                   |  20 +++
 arch/arm/kernel/Makefile                           |   2 -
 arch/arm64/include/asm/arm_pmuv3.h                 |  55 +++++++-
 arch/arm64/include/asm/kvm_host.h                  |   8 +-
 arch/arm64/include/asm/sysreg.h                    |   1 -
 arch/arm64/kvm/pmu-emul.c                          |  15 +-
 arch/arm64/kvm/pmu.c                               |  87 +++---------
 arch/arm64/kvm/sys_regs.c                          |  11 +-
 arch/arm64/tools/sysreg                            |  30 ++++
 drivers/perf/Kconfig                               |  12 ++
 drivers/perf/Makefile                              |   3 +
 drivers/perf/apple_m1_cpu_pmu.c                    |   4 +-
 drivers/perf/arm_pmu.c                             |  11 +-
 drivers/perf/arm_pmuv3.c                           | 154 +++++++++++----------
 .../perf_event_v6.c => drivers/perf/arm_v6_pmu.c   |  26 +---
 .../perf_event_v7.c => drivers/perf/arm_v7_pmu.c   |  90 ++++--------
 .../perf/arm_xscale_pmu.c                          |  15 +-
 include/kvm/arm_pmu.h                              |   8 +-
 include/linux/perf/arm_pmu.h                       |  10 +-
 include/linux/perf/arm_pmuv3.h                     |  11 +-
 20 files changed, 301 insertions(+), 272 deletions(-)
---
base-commit: 1613e604df0cd359cf2a7fbd9be7a0bcfacfabd0
change-id: 20240607-arm-pmu-3-9-icntr-04375ddd0082

Best regards,
-- 
Rob Herring (Arm) <robh@kernel.org>


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

end of thread, other threads:[~2024-07-10 12:36 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-26 22:32 [PATCH v2 00/12] arm64: Add support for Armv9.4 PMU fixed instruction counter Rob Herring (Arm)
2024-06-26 22:32 ` [PATCH v2 01/12] perf: arm_pmuv3: Avoid assigning fixed cycle counter with threshold Rob Herring (Arm)
2024-07-01 17:09   ` Mark Rutland
2024-06-26 22:32 ` [PATCH v2 02/12] perf: arm_pmuv3: Drop unnecessary IS_ENABLED(CONFIG_ARM64) check Rob Herring (Arm)
2024-07-01 17:11   ` Mark Rutland
2024-06-26 22:32 ` [PATCH v2 03/12] perf/arm: Move 32-bit PMU drivers to drivers/perf/ Rob Herring (Arm)
2024-06-26 22:32 ` [PATCH v2 04/12] perf: arm_v6/7_pmu: Drop non-DT probe support Rob Herring (Arm)
2024-06-26 22:32 ` [PATCH v2 05/12] perf: arm_pmuv3: Include asm/arm_pmuv3.h from linux/perf/arm_pmuv3.h Rob Herring (Arm)
2024-06-26 22:32 ` [PATCH v2 06/12] perf: arm_pmu: Remove event index to counter remapping Rob Herring (Arm)
2024-06-27 11:05   ` Marc Zyngier
2024-07-01 13:52     ` Will Deacon
2024-07-01 15:32       ` Mark Rutland
2024-07-01 15:49       ` Rob Herring
2024-07-02 16:19         ` Will Deacon
2024-07-01 17:06   ` Mark Rutland
2024-06-26 22:32 ` [PATCH v2 07/12] perf: arm_pmuv3: Prepare for more than 32 counters Rob Herring (Arm)
2024-06-26 22:32 ` [PATCH v2 08/12] KVM: arm64: pmu: Use arm_pmuv3.h register accessors Rob Herring (Arm)
2024-06-27 10:47   ` Marc Zyngier
2024-06-26 22:32 ` [PATCH v2 09/12] KVM: arm64: pmu: Use generated define for PMSELR_EL0.SEL access Rob Herring (Arm)
2024-06-27 10:47   ` Marc Zyngier
2024-06-26 22:32 ` [PATCH v2 10/12] arm64: perf/kvm: Use a common PMU cycle counter define Rob Herring (Arm)
2024-06-27 10:48   ` Marc Zyngier
2024-07-01 17:07   ` Mark Rutland
2024-06-26 22:32 ` [PATCH v2 11/12] KVM: arm64: Refine PMU defines for number of counters Rob Herring (Arm)
2024-06-27 10:54   ` Marc Zyngier
2024-06-26 22:32 ` [PATCH v2 12/12] perf: arm_pmuv3: Add support for Armv9.4 PMU instruction counter Rob Herring (Arm)
2024-07-01 17:20   ` Mark Rutland
2024-07-03 14:38 ` [PATCH v2 00/12] arm64: Add support for Armv9.4 PMU fixed " Will Deacon
2024-07-10 12:36   ` Will Deacon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).