From: Anshuman Khandual <anshuman.khandual@arm.com>
To: Sudeep Holla <sudeep.holla@arm.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Mike Leach <mike.leach@linaro.org>, Leo Yan <leo.yan@linaro.org>,
coresight@lists.linaro.org
Subject: Re: [PATCH] coresight: trbe: Move check for kernelspace unmapped at EL0 to probe
Date: Thu, 3 Feb 2022 11:55:58 +0530 [thread overview]
Message-ID: <01a43ba2-a633-f215-a688-2bda293b5a47@arm.com> (raw)
In-Reply-To: <20220201122212.3009461-1-sudeep.holla@arm.com>
On 2/1/22 5:52 PM, Sudeep Holla wrote:
> Currently with the check present in the module initialisation, it shouts
> on all the systems irrespective of presence of coresight trace buffer
> extensions.
IIUC a system with CONFIG_CORESIGHT_TRBE enabled but without a TRBE DT
i.e "arm,trace-buffer-extension" complains about kernel space unmapping
at EL0 (even though it does not even really have TRBE HW to initialize).
>
> Similar to Arm SPE perf driver, move the check for kernelspace unmapping
> when running at EL0 to the device probe instead of module initialisation.
Makes sense.
>
> Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
> Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
> Cc: Mike Leach <mike.leach@linaro.org>
> Cc: Leo Yan <leo.yan@linaro.org>
> Cc: Anshuman Khandual <anshuman.khandual@arm.com>
> Cc: coresight@lists.linaro.org
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
> drivers/hwtracing/coresight/coresight-trbe.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/hwtracing/coresight/coresight-trbe.c b/drivers/hwtracing/coresight/coresight-trbe.c
> index 276862c07e32..3fe2ce1ba5bf 100644
> --- a/drivers/hwtracing/coresight/coresight-trbe.c
> +++ b/drivers/hwtracing/coresight/coresight-trbe.c
> @@ -1423,6 +1423,11 @@ static int arm_trbe_device_probe(struct platform_device *pdev)
> struct device *dev = &pdev->dev;
> int ret;
>
Could you please add a similar comment like SPE driver regarding how
the TRBE buffer will be inaccessible, if kernel gets unmapped at EL0
and trace capture will terminate.
> + if (arm64_kernel_unmapped_at_el0()) {
> + pr_err("TRBE wouldn't work if kernel gets unmapped at EL0\n");
> + return -EOPNOTSUPP;
> + }
> +
> drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL);
> if (!drvdata)
> return -ENOMEM;
> @@ -1484,11 +1489,6 @@ static int __init arm_trbe_init(void)
> {
> int ret;
>
> - if (arm64_kernel_unmapped_at_el0()) {
> - pr_err("TRBE wouldn't work if kernel gets unmapped at EL0\n");
> - return -EOPNOTSUPP;
> - }
> -
> ret = platform_driver_register(&arm_trbe_driver);
> if (!ret)
> return 0;
>
_______________________________________________
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-02-03 6:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-01 12:22 [PATCH] coresight: trbe: Move check for kernelspace unmapped at EL0 to probe Sudeep Holla
2022-02-03 6:25 ` Anshuman Khandual [this message]
2022-02-03 12:04 ` Sudeep Holla
2022-02-03 12:17 ` Anshuman Khandual
2022-02-03 12:21 ` Suzuki K Poulose
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=01a43ba2-a633-f215-a688-2bda293b5a47@arm.com \
--to=anshuman.khandual@arm.com \
--cc=coresight@lists.linaro.org \
--cc=leo.yan@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.poirier@linaro.org \
--cc=mike.leach@linaro.org \
--cc=sudeep.holla@arm.com \
--cc=suzuki.poulose@arm.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