From: Robin Murphy <robin.murphy@arm.com>
To: will@kernel.org
Cc: mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, ilkka@os.amperecomputing.com
Subject: [PATCH v2 3/8] perf/arm-cmn: Ensure dtm_idx is big enough
Date: Mon, 2 Sep 2024 18:51:59 +0100 [thread overview]
Message-ID: <e771b358526a0d7fc06efee2c3a2fdc0c9f51d44.1725296395.git.robin.murphy@arm.com> (raw)
In-Reply-To: <cover.1725296395.git.robin.murphy@arm.com>
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: 23760a014417 ("perf/arm-cmn: Add CMN-700 support")
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
v2: Make the calculation more explicit
---
drivers/perf/arm-cmn.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c
index 4e2338afe669..48863b31ccfb 100644
--- a/drivers/perf/arm-cmn.c
+++ b/drivers/perf/arm-cmn.c
@@ -35,6 +35,9 @@
#define CMN_MAX_XPS (CMN_MAX_DIMENSION * CMN_MAX_DIMENSION)
#define CMN_MAX_DTMS (CMN_MAX_XPS + (CMN_MAX_DIMENSION - 1) * 4)
+/* Currently XPs are the node type we can have most of; others top out at 128 */
+#define CMN_MAX_NODES_PER_EVENT CMN_MAX_XPS
+
/* The CFG node has various info besides the discovery tree */
#define CMN_CFGM_PERIPH_ID_01 0x0008
#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) {}
struct arm_cmn_hw_event {
struct arm_cmn_node *dn;
- u64 dtm_idx[4];
+ u64 dtm_idx[DIV_ROUND_UP(CMN_MAX_NODES_PER_EVENT * 2, 64)];
s8 dtc_idx[CMN_MAX_DTCS];
u8 num_dns;
u8 dtm_offset;
--
2.39.2.101.g768bb238c484.dirty
next prev parent reply other threads:[~2024-09-02 17:52 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-02 17:51 [PATCH v2 0/8] perf/arm-cmn: Fixes and updates Robin Murphy
2024-09-02 17:51 ` [PATCH v2 1/8] perf/arm-cmn: Refactor node ID handling. Again Robin Murphy
2024-09-02 17:51 ` [PATCH v2 2/8] perf/arm-cmn: Fix CCLA register offset Robin Murphy
2024-09-02 17:51 ` Robin Murphy [this message]
2024-09-02 17:52 ` [PATCH v2 4/8] perf/arm-cmn: Improve build-time assertion Robin Murphy
2024-09-02 17:52 ` [PATCH v2 5/8] perf/arm-cmn: Make cycle counts less surprising Robin Murphy
2024-09-02 17:52 ` [PATCH v2 6/8] perf/arm-cmn: Refactor DTC PMU register access Robin Murphy
2024-09-02 17:52 ` [PATCH v2 7/8] dt-bindings: perf: arm-cmn: Add CMN S3 Robin Murphy
2024-09-02 17:52 ` [PATCH v2 8/8] perf/arm-cmn: Support " Robin Murphy
2024-09-04 16:12 ` [PATCH v2 0/8] perf/arm-cmn: Fixes and updates Will Deacon
2024-09-05 6:35 ` Ilkka Koskinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e771b358526a0d7fc06efee2c3a2fdc0c9f51d44.1725296395.git.robin.murphy@arm.com \
--to=robin.murphy@arm.com \
--cc=ilkka@os.amperecomputing.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®