lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200929133917.9224-14-leo.yan@linaro.org>
Date:   Tue, 29 Sep 2020 14:39:16 +0100
From:   Leo Yan <leo.yan@...aro.org>
To:     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>,
        Wei Li <liwei391@...wei.com>,
        James Clark <james.clark@....com>,
        Andre Przywara <andre.przywara@....com>,
        Dave Martin <Dave.Martin@....com>,
        linux-kernel@...r.kernel.org, Al Grant <Al.Grant@....com>
Cc:     Leo Yan <leo.yan@...aro.org>
Subject: [PATCH v2 13/14] perf arm_spe: Decode memory tagging properties

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 | 7 ++++++-
 tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.h | 2 ++
 2 files changed, 8 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 57a2d5494838..05a4c74399d7 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
@@ -270,6 +270,7 @@ int arm_spe_pkt_desc(const struct arm_spe_pkt *packet, char *buf,
 		     size_t buf_len)
 {
 	int ret, ns, el, idx = packet->index;
+	int ch, pat;
 	unsigned long long payload = packet->payload;
 	const char *name = arm_spe_pkt_name(packet->type);
 	size_t blen = buf_len;
@@ -438,9 +439,13 @@ int arm_spe_pkt_desc(const struct arm_spe_pkt *packet, char *buf,
 						    "VA 0x%llx", payload);
 		case SPE_ADDR_PKT_HDR_INDEX_DATA_PHYS:
 			ns = !!(packet->payload & SPE_ADDR_PKT_INST_VA_NS);
+			ch = !!(packet->payload & SPE_ADDR_PKT_DATA_PA_CH);
+			pat = (packet->payload & SPE_ADDR_PKT_DATA_PA_PAT_MASK)
+				>> SPE_ADDR_PKT_DATA_PA_PAT_SHIFT;
 			payload &= SPE_ADDR_PKT_ADDR_MASK;
 			return arm_spe_pkt_snprintf(&buf, &blen,
-						    "PA 0x%llx ns=%d", payload, ns);
+						    "PA 0x%llx ns=%d ch=%d, pat=%x",
+						    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 2c4086bf3149..1847cad517db 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
@@ -76,6 +76,8 @@ struct arm_spe_pkt {
 
 #define SPE_ADDR_PKT_DATA_PA_NS			BIT(63)
 #define SPE_ADDR_PKT_DATA_PA_CH			BIT(62)
+#define SPE_ADDR_PKT_DATA_PA_PAT_SHIFT          (56)
+#define SPE_ADDR_PKT_DATA_PA_PAT_MASK           GENMASK_ULL(59, 56)
 
 /* Address packet payload for instrcution virtual address */
 #define SPE_ADDR_PKT_INST_VA_NS			BIT(63)
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ