From: Will Deacon <will@kernel.org>
To: Srinivasarao Pathipati <quic_c_spathi@quicinc.com>
Cc: mark.rutland@arm.com, peterz@infradead.org, mingo@redhat.com,
acme@kernel.org, alexander.shishkin@linux.intel.com,
jolsa@kernel.org, namhyung@kernel.org, catalin.marinas@arm.com,
linux-arm-kernel@lists.infradead.org,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2] arm64: perf: Retain PMCR.X of PMCR_EL0 during reset
Date: Fri, 6 May 2022 15:12:14 +0100 [thread overview]
Message-ID: <20220506141213.GA23485@willie-the-truck> (raw)
In-Reply-To: <1651231749-19565-1-git-send-email-quic_c_spathi@quicinc.com>
On Fri, Apr 29, 2022 at 04:59:09PM +0530, Srinivasarao Pathipati wrote:
> Preserve the bit PMCR.X of PMCR_EL0 during PMU reset to export
> PMU events. as it could be set before PMU initialization.
>
> Signed-off-by: Srinivasarao Pathipati <quic_c_spathi@quicinc.com>
> ---
> Changes since V1:
> - Preserving only PMCR_X bit as per Robin Murphy's comment
> ---
> arch/arm64/kernel/perf_event.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c
> index cb69ff1..532a417 100644
> --- a/arch/arm64/kernel/perf_event.c
> +++ b/arch/arm64/kernel/perf_event.c
> @@ -1047,6 +1047,9 @@ static void armv8pmu_reset(void *info)
> if (armv8pmu_has_long_event(cpu_pmu))
> pmcr |= ARMV8_PMU_PMCR_LP;
>
> + /* Preserve PMCR_X to export PMU events */
> + pmcr |= (armv8pmu_pmcr_read() & ARMV8_PMU_PMCR_X);
I don't think this should be unconditional. Exporting events could easily
result in additional power consumption, and potentially even hardware
lockups.
Please stick this behind something like a sysctl toggle or sysfs control,
with documentation about what it does. It should default to disabled.
Will
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-05-06 14:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-29 11:29 [PATCH V2] arm64: perf: Retain PMCR.X of PMCR_EL0 during reset Srinivasarao Pathipati
2022-05-06 14:12 ` Will Deacon [this message]
2022-05-09 13:21 ` Srinivasarao Pathipati
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=20220506141213.GA23485@willie-the-truck \
--to=will@kernel.org \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=catalin.marinas@arm.com \
--cc=jolsa@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=quic_c_spathi@quicinc.com \
/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