Re: [PATCH 1/8] perf/arm-cmn: Refactor node ID handling. Again.

From: Robin Murphy
Date: Tue Aug 27 2024 - 09:52:03 EST


On 24/08/2024 2:00 am, Ilkka Koskinen wrote:
[...]
static struct arm_cmn_node *arm_cmn_node_to_xp(const struct arm_cmn *cmn,
                           const struct arm_cmn_node *dn)
{
-    struct arm_cmn_nodeid nid = arm_cmn_nid(cmn, dn->id);
-    int xp_idx = cmn->mesh_x * nid.y + nid.x;
+    int id = dn->id >> (dn->portid_bits + dn->deviceid_bits);
+    int bits = arm_cmn_xyidbits(cmn);
+    int x = id > bits;
                  ^^^

Instead of comparison, shouldn't that be bit shift?

Oh dear indeed... and of course the effects of that would only show up on hardware configurations I don't have. Good catch, thanks!

Cheers,
Robin.