Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf arm_spe: Decode SME data processing packet

For SME data processing, decode its Effective vector length or Tile Size
(ETS), and print out if a floating-point operation.

After:

. 00000000: 49 00 SME-OTHER ETS 1024 FP
. 00000002: b2 18 3c d7 83 00 80 ff ff VA 0xffff800083d73c18
. 0000000b: 9a 00 00 LAT 0 XLAT
. 0000000e: 43 00 DATA-SOURCE 0

Signed-off-by: Leo Yan <leo.yan@arm.com>
Reviewed-by: Ian Rogers <irogers@google.com>
Reviewed-by: James Clark <james.clark@linaro.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>

authored by

Leo Yan and committed by
Namhyung Kim
c4cfe1bc 876294a6

+20
+9
tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c
··· 351 351 arm_spe_pkt_out_string(&err, &buf, &buf_len, " FP"); 352 352 if (payload & SPE_OP_PKT_SVE_PRED) 353 353 arm_spe_pkt_out_string(&err, &buf, &buf_len, " PRED"); 354 + } else if (SPE_OP_PKT_OTHER_SUBCLASS_SME(payload)) { 355 + arm_spe_pkt_out_string(&err, &buf, &buf_len, "SME-OTHER"); 356 + 357 + /* SME effective vector length or tile size */ 358 + arm_spe_pkt_out_string(&err, &buf, &buf_len, " ETS %d", 359 + SPE_OP_PKG_SME_ETS(payload)); 360 + 361 + if (payload & SPE_OP_PKT_OTHER_FP) 362 + arm_spe_pkt_out_string(&err, &buf, &buf_len, " FP"); 354 363 } else if (SPE_OP_PKT_OTHER_SUBCLASS_OTHER(payload)) { 355 364 arm_spe_pkt_out_string(&err, &buf, &buf_len, "OTHER"); 356 365 if (payload & SPE_OP_PKT_OTHER_ASE)
+11
tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.h
··· 125 125 126 126 #define SPE_OP_PKT_OTHER_SUBCLASS_OTHER(v) (((v) & GENMASK_ULL(7, 3)) == 0x0) 127 127 #define SPE_OP_PKT_OTHER_SUBCLASS_SVE(v) (((v) & (BIT(7) | BIT(3) | BIT(0))) == 0x8) 128 + #define SPE_OP_PKT_OTHER_SUBCLASS_SME(v) (((v) & (BIT(7) | BIT(3) | BIT(0))) == 0x88) 128 129 129 130 #define SPE_OP_PKT_OTHER_ASE BIT(2) 130 131 #define SPE_OP_PKT_OTHER_FP BIT(1) 132 + 133 + /* 134 + * SME effective vector length or tile size (ETS) is stored in byte 0 135 + * bits [6:4,2]; the length is rounded up to a power of two and use 128 136 + * as one step, so ETS calculation is: 137 + * 138 + * 128 * (2 ^ bits [6:4,2]) = 32 << (bits [6:4,2]) 139 + */ 140 + #define SPE_OP_PKG_SME_ETS(v) (128 << (FIELD_GET(GENMASK_ULL(6, 4), (v)) << 1 | \ 141 + (FIELD_GET(BIT(2), (v))))) 131 142 132 143 #define SPE_OP_PKT_LDST_SUBCLASS_GP_REG(v) (((v) & GENMASK_ULL(7, 1)) == 0x0) 133 144 #define SPE_OP_PKT_LDST_SUBCLASS_SIMD_FP(v) (((v) & GENMASK_ULL(7, 1)) == 0x4)