perf/arm-cmn: Refactor node ID handling. Again.
authorRobin Murphy <robin.murphy@arm.com>
Mon, 2 Sep 2024 17:51:57 +0000 (18:51 +0100)
committerWill Deacon <will@kernel.org>
Wed, 4 Sep 2024 15:04:07 +0000 (16:04 +0100)
commite79634b53e398966c49f803c49701bc74dc3ccf8
tree5e601227a14d1faf6092989cc20cac84eeb8a9d6
parentd1c93d5c67ebc7cf5b70ecff7172a0c399975d55
perf/arm-cmn: Refactor node ID handling. Again.

The scope of the "extra device ports" configuration is not made clear by
the CMN documentation - so far we've assumed it applies globally, based
on the sole example which suggests as much. However it transpires that
this is incorrect, and the format does in fact vary based on each
individual XP's port configuration. As a consequence, we're currenly
liable to decode the port/device indices from a node ID incorrectly,
thus program the wrong event source in the DTM leading to bogus event
counts, and also show device topology on the wrong ports in debugfs.

To put this right, rework node IDs yet again to carry around the
additional data necessary to decode them properly per-XP. At this point
the notion of fully decomposing an ID becomes more impractical than it's
worth, so unabstracting the XY mesh coordinates (where 2/3 users were
just debug anyway) ends up leaving things a bit simpler overall.

Fixes: 60d1504070c2 ("perf/arm-cmn: Support new IP features")
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/5195f990152fc37adba5fbf5929a6b11063d9f09.1725296395.git.robin.murphy@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/perf/arm-cmn.c