perf: arm_pmuv3: Add support for Armv9.4 PMU instruction counter
authorRob Herring (Arm) <robh@kernel.org>
Wed, 31 Jul 2024 16:51:24 +0000 (10:51 -0600)
committerWill Deacon <will@kernel.org>
Fri, 16 Aug 2024 12:09:12 +0000 (13:09 +0100)
commitd8226d8cfbaf5eb9771af8ad8b4e58697e2ffb74
treedd53139085c19105c854dcdd188291e4c6baf1d8
parent2f62701fa5b0ee94c68d2fcfc470d08aef195441
perf: arm_pmuv3: Add support for Armv9.4 PMU instruction counter

Armv9.4/8.9 PMU adds optional support for a fixed instruction counter
similar to the fixed cycle counter. Support for the feature is indicated
in the ID_AA64DFR1_EL1 register PMICNTR field. The counter is not
accessible in AArch32.

Existing userspace using direct counter access won't know how to handle
the fixed instruction counter, so we have to avoid using the counter
when user access is requested.

Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Tested-by: James Clark <james.clark@linaro.org>
Link: https://lore.kernel.org/r/20240731-arm-pmu-3-9-icntr-v3-7-280a8d7ff465@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm/include/asm/arm_pmuv3.h
arch/arm64/include/asm/arm_pmuv3.h
arch/arm64/kvm/pmu.c
arch/arm64/tools/sysreg
drivers/perf/arm_pmuv3.c
include/linux/perf/arm_pmu.h
include/linux/perf/arm_pmuv3.h