[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201102162519.GA6882@arm.com>
Date: Mon, 2 Nov 2020 16:25:36 +0000
From: Dave Martin <Dave.Martin@....com>
To: Leo Yan <leo.yan@...aro.org>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Mark Rutland <Mark.Rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...hat.com>,
Namhyung Kim <namhyung@...nel.org>,
Andre Przywara <Andre.Przywara@....com>,
James Clark <James.Clark@....com>, Al Grant <Al.Grant@....com>,
Wei Li <liwei391@...wei.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v6 20/21] perf arm_spe: Decode memory tagging properties
On Fri, Oct 30, 2020 at 02:57:23AM +0000, Leo Yan wrote:
> From: Andre Przywara <andre.przywara@....com>
>
> When SPE records a physical address, it can additionally tag the event
> with information from the Memory Tagging architecture extension.
>
> Decode the two additional fields in the SPE event payload.
>
> [leoy: Refined patch to use predefined macros]
>
> Signed-off-by: Andre Przywara <andre.przywara@....com>
> Signed-off-by: Leo Yan <leo.yan@...aro.org>
> ---
> tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c | 6 +++++-
> tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.h | 2 ++
> 2 files changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c b/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c
> index 3fca65e9cbbf..9ec3057de86f 100644
> --- a/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c
> +++ b/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c
> @@ -371,6 +371,7 @@ static int arm_spe_pkt_desc_addr(const struct arm_spe_pkt *packet,
> char *buf, size_t buf_len)
> {
> int ns, el, idx = packet->index;
> + int ch, pat;
> u64 payload = packet->payload;
> int err = 0;
>
> @@ -388,9 +389,12 @@ static int arm_spe_pkt_desc_addr(const struct arm_spe_pkt *packet,
> "VA 0x%llx", payload);
> case SPE_ADDR_PKT_HDR_INDEX_DATA_PHYS:
> ns = !!SPE_ADDR_PKT_GET_NS(payload);
> + ch = !!SPE_ADDR_PKT_GET_CH(payload);
> + pat = SPE_ADDR_PKT_GET_PAT(payload);
> payload = SPE_ADDR_PKT_ADDR_GET_BYTES_0_6(payload);
> return arm_spe_pkt_snprintf(&err, &buf, &buf_len,
> - "PA 0x%llx ns=%d", payload, ns);
> + "PA 0x%llx ns=%d ch=%d, pat=%x",
Nit: given that this data is all closely related, do we really want the
extra comma here?
(Note, I am not familiar with how this text is consumed, so if there are
other reasons why the comma is needed then that's probably fine.)
> + payload, ns, ch, pat);
> default:
> return 0;
> }
> diff --git a/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.h b/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.h
> index 7032fc141ad4..1ad14885c2a1 100644
> --- a/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.h
> +++ b/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.h
> @@ -73,6 +73,8 @@ struct arm_spe_pkt {
>
> #define SPE_ADDR_PKT_GET_NS(v) (((v) & BIT_ULL(63)) >> 63)
> #define SPE_ADDR_PKT_GET_EL(v) (((v) & GENMASK_ULL(62, 61)) >> 61)
> +#define SPE_ADDR_PKT_GET_CH(v) (((v) & BIT_ULL(62)) >> 62)
> +#define SPE_ADDR_PKT_GET_PAT(v) (((v) & GENMASK_ULL(59, 56)) >> 56)
These seem to match the spec.
With or without addressing the nit above:
Reviewed-by: Dave Martin <Dave.Martin@....com>
[...]
Cheers
---Dave
Powered by blists - more mailing lists