Skip to content

Commit 359414b

Browse files
rmurphy-armwilldeacon
authored andcommitted
perf/arm-cmn: Ensure dtm_idx is big enough
While CMN_MAX_DIMENSION was bumped to 12 for CMN-650, that only supports up to a 10x10 mesh, so bumping dtm_idx to 256 bits at the time worked out OK in practice. However CMN-700 did finally support up to 144 XPs, and thus needs a worst-case 288 bits of dtm_idx for an aggregated XP event on a maxed-out config. Oops. Fixes: 23760a0 ("perf/arm-cmn: Add CMN-700 support") Signed-off-by: Robin Murphy <[email protected]> Link: https://lore.kernel.org/r/e771b358526a0d7fc06efee2c3a2fdc0c9f51d44.1725296395.git.robin.murphy@arm.com Signed-off-by: Will Deacon <[email protected]>
1 parent 88b63a8 commit 359414b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/perf/arm-cmn.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
#define CMN_MAX_XPS (CMN_MAX_DIMENSION * CMN_MAX_DIMENSION)
3636
#define CMN_MAX_DTMS (CMN_MAX_XPS + (CMN_MAX_DIMENSION - 1) * 4)
3737

38+
/* Currently XPs are the node type we can have most of; others top out at 128 */
39+
#define CMN_MAX_NODES_PER_EVENT CMN_MAX_XPS
40+
3841
/* The CFG node has various info besides the discovery tree */
3942
#define CMN_CFGM_PERIPH_ID_01 0x0008
4043
#define CMN_CFGM_PID0_PART_0 GENMASK_ULL(7, 0)
@@ -564,7 +567,7 @@ static void arm_cmn_debugfs_init(struct arm_cmn *cmn, int id) {}
564567

565568
struct arm_cmn_hw_event {
566569
struct arm_cmn_node *dn;
567-
u64 dtm_idx[4];
570+
u64 dtm_idx[DIV_ROUND_UP(CMN_MAX_NODES_PER_EVENT * 2, 64)];
568571
s8 dtc_idx[CMN_MAX_DTCS];
569572
u8 num_dns;
570573
u8 dtm_offset;

0 commit comments

Comments
 (0)