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 1/5] selftests/arm64: Log errors in verify_mte_pointer_validity()
Date: Tue, 10 May 2022 11:15:41 -0600 [thread overview]
Message-ID: <dfb1b1d4-e932-733a-2cae-1cf850801625@linuxfoundation.org> (raw)
In-Reply-To: <20220510164520.768783-2-broonie@kernel.org>
On 5/10/22 10:45 AM, Mark Brown wrote:
> When we detect a problem in verify_mte_pointer_validity() while checking
> tags we don't log what the problem was which makes debugging harder. Add
> some diagnostics.
>
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---
> .../selftests/arm64/mte/check_tags_inclusion.c | 12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/tools/testing/selftests/arm64/mte/check_tags_inclusion.c b/tools/testing/selftests/arm64/mte/check_tags_inclusion.c
> index deaef1f61076..b906914997ce 100644
> --- a/tools/testing/selftests/arm64/mte/check_tags_inclusion.c
> +++ b/tools/testing/selftests/arm64/mte/check_tags_inclusion.c
> @@ -25,8 +25,11 @@ static int verify_mte_pointer_validity(char *ptr, int mode)
> /* Check the validity of the tagged pointer */
> memset((void *)ptr, '1', BUFFER_SIZE);
> mte_wait_after_trig();
> - if (cur_mte_cxt.fault_valid)
> + if (cur_mte_cxt.fault_valid) {
> + ksft_print_msg("Unexpected fault recorded for %p-%p in mode %x\n",
> + ptr, ptr + BUFFER_SIZE, mode);
> return KSFT_FAIL;
> + }
> /* Proceed further for nonzero tags */
> if (!MT_FETCH_TAG((uintptr_t)ptr))
> return KSFT_PASS;
> @@ -34,10 +37,13 @@ static int verify_mte_pointer_validity(char *ptr, int mode)
> /* Check the validity outside the range */
> ptr[BUFFER_SIZE] = '2';
> mte_wait_after_trig();
> - if (!cur_mte_cxt.fault_valid)
> + if (!cur_mte_cxt.fault_valid) {
> + ksft_print_msg("No valid fault recorded for %p in mode %x\n",
> + ptr, mode);
> return KSFT_FAIL;
> - else
> + } else {
> return KSFT_PASS;
> + }
> }
>
> static int check_single_included_tags(int mem_type, int mode)
>
Nice. Thanks for the patch.
It would be a nice addition to print mode names as strings to make
it easy to understand. Could done in a future patch. e,g: MTE_NONE_ERR etc.
Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
thanks,
-- Shuah
next prev parent reply other threads:[~2022-05-10 17:16 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 [this message]
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
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=dfb1b1d4-e932-733a-2cae-1cf850801625@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