[PATCH v6 9/9] kselftest/arm64/mte: add mtefar tests on check_mmap_options

Mark Brown broonie at kernel.org
Wed Jun 11 05:25:23 PDT 2025


On Wed, Jun 11, 2025 at 10:41:07AM +0100, Yeoreum Yun wrote:

> +static int check_anonymous_memory_mapping(int mem_type, int mode, int mapping, int tag_check, int atag_check)
>  {
>  	char *ptr, *map_ptr;
>  	int run, result, map_size;
> @@ -97,16 +106,16 @@ static int check_anonymous_memory_mapping(int mem_type, int mode, int mapping, i
>  			munmap((void *)map_ptr, map_size);
>  			return KSFT_FAIL;
>  		}
> -		result = check_mte_memory(ptr, sizes[run], mode, tag_check);
> +		result = check_mte_memory(ptr, sizes[run], mode, tag_check, atag_check);
>  		mte_clear_tags((void *)ptr, sizes[run]);
>  		mte_free_memory((void *)map_ptr, map_size, mem_type, false);
> -		if (result == KSFT_FAIL)
> -			return KSFT_FAIL;
> +		if (result != KSFT_SKIP)
> +			return result;
>  	}

This changes the logic to exit the loop immediately if the check passes
which doesn't seem like what we want, should we instead change the test
to be:

	if (result != KSFT_PASS)

which I think is more the intent?

> +		result = check_mte_memory(ptr, sizes[run], mode, TAG_CHECK_ON, atag_check);
>  		mte_free_memory_tag_range((void *)ptr, sizes[run], mem_type, UNDERFLOW, OVERFLOW);
>  		if (result != KSFT_PASS)
>  			return KSFT_FAIL;
> @@ -192,7 +201,7 @@ static int check_clear_prot_mte_flag(int mem_type, int mode, int mapping)
>  			close(fd);
>  			return KSFT_FAIL;
>  		}

Won't this upgrade any skips to fails?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20250611/edfc801a/attachment.sig>


More information about the linux-arm-kernel mailing list