]> git.proxmox.com Git - mirror_ubuntu-hirsute-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)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 19 May 2021 08:31:59 +0000 (10:31 +0200)
commit4198420c4ff12f46bc64e07c48c32d1abf7c17b4
tree65a9ff64ca39bf8c3f796cec509a464486275575
parent4378dd94c70cd3688908a6264776ea745f49514f
kselftest/arm64: mte: Fix MTE feature detection

BugLink: https://bugs.launchpad.net/bugs/1928857
[ Upstream commit 592432862cc4019075a7196d9961562c49507d6f ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
tools/testing/selftests/arm64/mte/mte_common_util.c