Skip to content

kselftest/arm64: mte: Fix feature detection and compilation

Andre Przywara linux-arm-kernel linux-kselftest 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest11 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11kselftest/arm64: mte: Fix compilation with native compilertools/testing/selftests/arm64/mte/Makefile+0 -21 reply
2/11kselftest/arm64: mte: Fix pthread linkingtools/testing/selftests/arm64/mte/Makefile+2 -10 replies
3/11kselftest/arm64: mte: ksm_options: Fix fscanf warningtools/testing/selftests/arm64/mte/check_ksm_options.c+4 -10 replies
4/11kselftest/arm64: mte: user_mem: Fix write() warningtools/testing/selftests/arm64/mte/check_user_mem.c+2 -10 replies
5/11kselftest/arm64: mte: common: Fix write() warningstools/testing/selftests/arm64/mte/mte_common_util.c+18 -50 replies
6/11kselftest/arm64: mte: Fix MTE feature detectiontools/testing/selftests/arm64/mte/mte_common_util.c+2 -110 replies
7/11kselftest/arm64: mte: Use cross-compiler if specifiedtools/testing/selftests/arm64/mte/Makefile+5 -00 replies
8/11kselftest/arm64: mte: Output warning about failing compilertools/testing/selftests/arm64/mte/Makefile+3 -00 replies
9/11kselftest/arm64: mte: Makefile: Fix clang compilationtools/testing/selftests/arm64/mte/Makefile+1 -10 replies
10/11kselftest/arm64: mte: Fix clang warningtools/testing/selftests/arm64/mte/mte_common_util.c+1 -11 reply
11/11kselftest/arm64: mte: Report filename on failing temp file creationtools/testing/selftests/arm64/mte/mte_common_util.c+1 -00 replies

Reviews trailers per patch

3 of 11 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchAndre PrzywaraMark BrownNick Desaulniers
SeriesR-b
1/11R-b
2/11
3/11
4/11
5/11R-b
6/11R-b
7/11
8/11
9/11
10/11
11/11

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [PATCH 00/11] kselftest/arm64: mte: Fix feature detection and compilation

When trying to run the arm64 MTE (Memory Tagging Extension) selftests on a model with the new FEAT_MTE3 capability, the MTE feature detection failed, because it was overzealously checking for one exact feature version only (0b0010). Trying to fix that (patch 06/11) led me into the rabbit hole of userland tool compilation, which triggered patches 01-05/11, to let me actually compile the selftests on an arm64 machine running Ubuntu 20.04. Before I actually fixed that, I tried some other compiler and distro; patches 07 and 08 are my witnesses. Then I got brave and tried clang: entering patches 09/11 and 10/11. Eventually I tried to run the whole thing on that model again, and, you guessed it, patch 11/11 concludes this apparent "2 minute job".

Eventually I can now compile the mte selftests on Ubuntu 20.04 with both the native gcc and clang without warnings, also with some custom made cross compiler. And they even run now!

Please have a look, also you may try to compile it on your setup, if you feel adventurous:

$ make -C tools/testing/selftests TARGETS=arm64 ARM64_SUBTARGETS=mte

Cheers,
Andre

Andre Przywara (11):
kselftest/arm64: mte: Fix compilation with native compiler kselftest/arm64: mte: Fix pthread linking kselftest/arm64: mte: ksm_options: Fix fscanf warning kselftest/arm64: mte: user_mem: Fix write() warning kselftest/arm64: mte: common: Fix write() warnings kselftest/arm64: mte: Fix MTE feature detection kselftest/arm64: mte: Use cross-compiler if specified kselftest/arm64: mte: Output warning about failing compiler kselftest/arm64: mte: Makefile: Fix clang compilation kselftest/arm64: mte: Fix clang warning
kselftest/arm64: mte: Report filename on failing temp file creation

 tools/testing/selftests/arm64/mte/Makefile    | 15 +++++--
 .../selftests/arm64/mte/check_ksm_options.c   |  5 ++-
 .../selftests/arm64/mte/check_user_mem.c      |  3 +-
 .../selftests/arm64/mte/mte_common_util.c     | 39 +++++++++++--------
 4 files changed, 39 insertions(+), 23 deletions(-)
Signature · 1 line
2.17.5