linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Shuah Khan <skhan@linuxfoundation.org>
To: Mark Brown <broonie@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>, Shuah Khan <shuah@kernel.org>
Cc: Joey Gouly <joey.gouly@arm.com>,
	linux-kselftest@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH v1 2/5] selftests/arm64: Allow zero tags in mte_switch_mode()
Date: Tue, 10 May 2022 11:17:42 -0600	[thread overview]
Message-ID: <7052abba-667c-36bf-30ee-58671de655ac@linuxfoundation.org> (raw)
In-Reply-To: <20220510164520.768783-3-broonie@kernel.org>

On 5/10/22 10:45 AM, Mark Brown wrote:
> mte_switch_mode() currently rejects attempts to set a zero tag however
> there are tests such as check_tags_inclusion which attempt to cover cases
> with zero tags using mte_switch_mode(). Since it is not clear why we are
> rejecting zero tags change the test to accept them.
> 
> The issue has not previously been as apparent as it should be since the
> return value of mte_switch_mode() was not always checked in the callers
> and the tests weren't otherwise failing.
> 
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---
>   tools/testing/selftests/arm64/mte/mte_common_util.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/arm64/mte/mte_common_util.c b/tools/testing/selftests/arm64/mte/mte_common_util.c
> index 260206f4dce0..6ff4c4bcbff1 100644
> --- a/tools/testing/selftests/arm64/mte/mte_common_util.c
> +++ b/tools/testing/selftests/arm64/mte/mte_common_util.c
> @@ -283,7 +283,7 @@ int mte_switch_mode(int mte_option, unsigned long incl_mask)
>   		return -EINVAL;
>   	}
>   
> -	if (!(incl_mask <= MTE_ALLOW_NON_ZERO_TAG)) {
> +	if (incl_mask & ~MT_INCLUDE_TAG_MASK) {
>   		ksft_print_msg("FAIL: Invalid incl_mask %lx\n", incl_mask);
>   		return -EINVAL;
>   	}
> 

Looks good to me.

Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>

thanks,
-- Shuah

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-05-10 17:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-10 16:45 [PATCH v1 0/5] selftests/arm64: MTE check_tags_inclusion cleanups Mark Brown
2022-05-10 16:45 ` [PATCH v1 1/5] selftests/arm64: Log errors in verify_mte_pointer_validity() Mark Brown
2022-05-10 17:15   ` Shuah Khan
2022-05-10 16:45 ` [PATCH v1 2/5] selftests/arm64: Allow zero tags in mte_switch_mode() Mark Brown
2022-05-10 17:17   ` Shuah Khan [this message]
2022-05-10 16:45 ` [PATCH v1 3/5] selftests/arm64: Check failures to set tags in check_tags_inclusion Mark Brown
2022-05-10 17:19   ` Shuah Khan
2022-05-10 16:45 ` [PATCH v1 4/5] selftests/arm64: Remove casts to/from void " Mark Brown
2022-05-10 17:23   ` Shuah Khan
2022-05-10 16:45 ` [PATCH v1 5/5] selftests/arm64: Use switch statements in mte_common_util.c Mark Brown
2022-05-15 10:45 ` [PATCH v1 0/5] selftests/arm64: MTE check_tags_inclusion cleanups Catalin Marinas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7052abba-667c-36bf-30ee-58671de655ac@linuxfoundation.org \
    --to=skhan@linuxfoundation.org \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=joey.gouly@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=shuah@kernel.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).