kselftest/arm64: mte: use proper SKIP syntax

If MTE is not available on a system, we detect this early and skip all
the MTE selftests. However this happens before we print the TAP plan, so
tools parsing the TAP output get confused and report an error.

Use the existing ksft_exit_skip() function to handle this, which uses a
dummy plan to work with tools expecting proper TAP syntax, as described
in the TAP specification.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20240816153251.2833702-4-andre.przywara@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
This commit is contained in:
Andre Przywara 2024-08-16 16:32:46 +01:00 committed by Catalin Marinas
parent b0d80dbc37
commit bf52ca5912

View File

@ -319,10 +319,9 @@ int mte_default_setup(void)
unsigned long en = 0;
int ret;
if (!(hwcaps2 & HWCAP2_MTE)) {
ksft_print_msg("SKIP: MTE features unavailable\n");
return KSFT_SKIP;
}
if (!(hwcaps2 & HWCAP2_MTE))
ksft_exit_skip("MTE features unavailable\n");
/* Get current mte mode */
ret = prctl(PR_GET_TAGGED_ADDR_CTRL, en, 0, 0, 0);
if (ret < 0) {