]> git.baikalelectronics.ru Git - kernel.git/commit
kselftest/arm64: mte: Fix MTE feature detection
authorAndre Przywara <andre.przywara@arm.com>
Fri, 19 Mar 2021 16:53:29 +0000 (16:53 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Wed, 24 Mar 2021 15:43:14 +0000 (15:43 +0000)
commitfaa7a728af341d0813885a3b3d2986bc6c577677
tree740fd53aa032f3fa7dbdbdb42673913278e78888
parentc9246d3ef9601b4c8e4bb2fcc8a16a048e1321c9
kselftest/arm64: mte: Fix MTE feature detection

To check whether the CPU and kernel support the MTE features we want
to test, we use an (emulated) CPU ID register read. However we only
check against a very particular feature version (0b0010), even though
the ARM ARM promises ID register features to be backwards compatible.

While this could be fixed by using ">=" instead of "==", we should
actually use the explicit HWCAP2_MTE hardware capability, exposed by the
kernel via the ELF auxiliary vectors.

That moves this responsibility to the kernel, and fixes running the
tests on machines with FEAT_MTE3 capability.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Mark Brown <broone@kernel.org>
Link: https://lore.kernel.org/r/20210319165334.29213-7-andre.przywara@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
tools/testing/selftests/arm64/mte/mte_common_util.c