Re: [PATCH v3 0/7] arm64: Add support for Armv9.4 PMU fixed instruction counter

From: James Clark
Date: Thu Aug 08 2024 - 06:41:54 EST




On 31/07/2024 5:51 pm, Rob Herring (Arm) wrote:
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.

Patch 1 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 2 updates various register accessors to use 64-bit values matching
the register size.

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

Patches 5-6 rework KVM and perf PMU defines for counter indexes and
number of counters.

Patch 7 finally adds support for the fixed instruction counter.

I tested this on FVP with VHE host and a guest. Also ran kvm-unittests
in Arm's kernelCI.


I ran the Perf tests and poked around a bit with PMUs and chaining events (on non-fixed instruction counter hardware):

Tested-by: James Clark <james.clark@xxxxxxxxxx>