mbox series

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

Message ID 20210319165334.29213-1-andre.przywara@arm.com (mailing list archive)
Headers show
Series kselftest/arm64: mte: Fix feature detection and compilation | expand

Message

Andre Przywara March 19, 2021, 4:53 p.m. UTC
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(-)

Comments

Mark Brown March 19, 2021, 5:12 p.m. UTC | #1
On Fri, Mar 19, 2021 at 04:53:23PM +0000, Andre Przywara wrote:
> 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

Reviewed-by: Mark Brown <broone@kernel.org>
Catalin Marinas March 23, 2021, 5:54 p.m. UTC | #2
On Fri, 19 Mar 2021 16:53:23 +0000, Andre Przywara wrote:
> 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".
> 
> [...]

Applied to arm64 (for-next/kselftest), thanks!

[01/11] kselftest/arm64: mte: Fix compilation with native compiler
        https://git.kernel.org/arm64/c/4a423645bc26
[02/11] kselftest/arm64: mte: Fix pthread linking
        https://git.kernel.org/arm64/c/e5decefd884d
[03/11] kselftest/arm64: mte: ksm_options: Fix fscanf warning
        https://git.kernel.org/arm64/c/31c88729a7ad
[04/11] kselftest/arm64: mte: user_mem: Fix write() warning
        https://git.kernel.org/arm64/c/40de85226fec
[05/11] kselftest/arm64: mte: common: Fix write() warnings
        https://git.kernel.org/arm64/c/4dfc9d30a8ab
[06/11] kselftest/arm64: mte: Fix MTE feature detection
        https://git.kernel.org/arm64/c/b17f265bb4cc
[07/11] kselftest/arm64: mte: Use cross-compiler if specified
        https://git.kernel.org/arm64/c/28cc9b3d8996
[08/11] kselftest/arm64: mte: Output warning about failing compiler
        https://git.kernel.org/arm64/c/6b9bbb7f934d
[09/11] kselftest/arm64: mte: Makefile: Fix clang compilation
        https://git.kernel.org/arm64/c/adb73140eec7
[10/11] kselftest/arm64: mte: Fix clang warning
        https://git.kernel.org/arm64/c/005a62f6d269
[11/11] kselftest/arm64: mte: Report filename on failing temp file creation
        https://git.kernel.org/arm64/c/b4985bb88afb