From: "Rob Herring (Arm)" <robh@kernel.org>
To: Will Deacon <will@kernel.org>, Mark Rutland <mark.rutland@arm.com>
Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: [PATCH] perf: arm_pmuv3: Fix chained event check for cycle counter
Date: Wed, 10 Jul 2024 12:23:56 -0600 [thread overview]
Message-ID: <20240710182357.3701635-1-robh@kernel.org> (raw)
Since commit b7e89b0f5bd7 ("perf: arm_pmu: Remove event index to
counter remapping"), armv8pmu_event_is_chained() is incorrectly
returning that the cycle counter is chained, but the cycle counter has
always been 64-bit. The result is trying to configure counter #30 which
typically doesn't exist.
As ARMV8_PMU_MAX_GENERAL_COUNTERS is the number of counters (31), the
comparison to the counter index needs to be '<' rather than '<='.
Fixes: b7e89b0f5bd7 ("perf: arm_pmu: Remove event index to counter remapping")
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
---
drivers/perf/arm_pmuv3.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/perf/arm_pmuv3.c b/drivers/perf/arm_pmuv3.c
index 3b3a3334cc3f..0e22c68fb804 100644
--- a/drivers/perf/arm_pmuv3.c
+++ b/drivers/perf/arm_pmuv3.c
@@ -482,7 +482,7 @@ static bool armv8pmu_event_is_chained(struct perf_event *event)
return !armv8pmu_event_has_user_read(event) &&
armv8pmu_event_is_64bit(event) &&
!armv8pmu_has_long_event(cpu_pmu) &&
- (idx <= ARMV8_PMU_MAX_GENERAL_COUNTERS);
+ (idx < ARMV8_PMU_MAX_GENERAL_COUNTERS);
}
/*
--
2.43.0
next reply other threads:[~2024-07-10 18:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-10 18:23 Rob Herring (Arm) [this message]
2024-08-01 11:29 ` Will Deacon
2024-08-01 17:19 ` Rob Herring
2024-08-02 10:24 ` Will Deacon
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=20240710182357.3701635-1-robh@kernel.org \
--to=robh@kernel.org \
--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®