From: Leo Yan <leo.yan@arm.com>
To: moonafterrain@outlook.com
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>,
Mike Leach <mike.leach@arm.com>,
James Clark <james.clark@linaro.org>,
Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Linu Cherian <lcherian@marvell.com>,
coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
Yuhao Jiang <danisjiang@gmail.com>,
stable@vger.kernel.org
Subject: Re: [PATCH] coresight: configfs: restrict address parameter value to root
Date: Wed, 12 Aug 2026 15:12:57 +0100 [thread overview]
Message-ID: <20260812141257.GK15499@e132581.arm.com> (raw)
In-Reply-To: <20260812-coresight-fixes-v1-1-53fbf4e73241@outlook.com>
On Wed, Aug 12, 2026 at 05:13:14PM +0800, Junrui Luo via B4 Relay wrote:
> Mark parameters that can hold a kernel address, and give those a
> config_item_type whose 'value' attribute is 0600. Parameters holding
> plain numbers, such as the strobing 'window' and 'period' counts, keep
> the existing mode.
Thanks for reporting the issue.
The patch seems overly complex to me. I'd suggest:
--- a/drivers/hwtracing/coresight/coresight-syscfg-configfs.c
+++ b/drivers/hwtracing/coresight/coresight-syscfg-configfs.c
@@ -281,9 +281,16 @@ static ssize_t cscfg_param_value_show(struct config_item *item, char *page)
{
struct cscfg_fs_param *param_item = container_of(to_config_group(item),
struct cscfg_fs_param, group);
- u64 value = param_item->feat_desc->params_desc[param_item->param_idx].value;
-
- return scnprintf(page, PAGE_SIZE, "0x%llx\n", value);
+ struct cscfg_parameter_desc *param_desc =
+ param_item->feat_desc->params_desc + param_item->param_idx;
+ const char *name = param_desc->name;
+ u64 value = param_desc->value;
+
+ /* The kernel address should print with the "%pK" specifier */
+ if (!strncmp(name, "address"))
+ return scnprintf(page, PAGE_SIZE, "0x%pK\n", value);
+ else
+ return scnprintf(page, PAGE_SIZE, "0x%llx\n", value);
}
We can add a flag (e.g., is_addr) in cscfg_parameter_desc to indicate
a parameter presents an address. Since currently only pstop's "address"
parameter has this issue, adding a general flag can be deferred until
it is actually needed.
Thanks,
Leo
prev parent reply other threads:[~2026-08-12 14:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-12 9:13 [PATCH] coresight: configfs: restrict address parameter value to root Junrui Luo via B4 Relay
2026-08-12 14:12 ` Leo Yan [this message]
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=20260812141257.GK15499@e132581.arm.com \
--to=leo.yan@arm.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=corbet@lwn.net \
--cc=coresight@lists.linaro.org \
--cc=danisjiang@gmail.com \
--cc=james.clark@linaro.org \
--cc=lcherian@marvell.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mike.leach@arm.com \
--cc=moonafterrain@outlook.com \
--cc=skhan@linuxfoundation.org \
--cc=stable@vger.kernel.org \
--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