All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amit Kachhap <amit.kachhap@arm.com>
To: Mark Brown <broonie@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>, Shuah Khan <shuah@kernel.org>,
	Boyan Karatotev <boyan.karatotev@arm.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kselftest@vger.kernel.org
Subject: Re: [PATCH] kselftest/arm64: pac: Fix skipping of tests on systems without PAC
Date: Fri, 20 Aug 2021 17:05:05 +0530	[thread overview]
Message-ID: <20d96c3e-36f8-276f-ab02-daf5bc7c976f@arm.com> (raw)
In-Reply-To: <20210820105531.GP4177@sirena.org.uk>



On 8/20/21 4:25 PM, Mark Brown wrote:
> On Fri, Aug 20, 2021 at 12:39:39PM +0530, Amit Kachhap wrote:
>> On 8/19/21 10:27 PM, Mark Brown wrote:
> 
>>> -	ASSERT_NE(0, hwcaps & HWCAP_PACA) TH_LOG("PAUTH not enabled"); \
>>> +	if (!(hwcaps & HWCAP_PACA))					\
>>> +		SKIP(return, "PAUTH not enabled"); \
>>>    } while (0)
>>>    #define ASSERT_GENERIC_PAUTH_ENABLED() \
> 
>> May be ASSERT_GENERIC_PAUTH_ENABLED can be replaced with
>> something like VERIFY_GENERIC_PAUTH_ENABLED
> 
> I thought briefly about bikeshedding the name but didn't come up with
> anything that was sufficiently better/clearer.
> 
>> or can be modified like below and instead of failing it skips with a
>> message
> 
>>    -	ASSERT_NE(0, hwcaps & HWCAP_PACA) TH_LOG("PAUTH not enabled"); \
>>    +	ASSERT_NE(0, hwcaps & HWCAP_PACA) SKIP(return, "PAUTH not enabled");
> 
> That's what the patch does?

Agree, I saw few other testcases where ASSERT is used along with SKIP.
(tools/testing/selftests/core/close_range_test.c) so this way 
ASSERT_GENERIC_* macro will be clear. There will be just an extra
log like "hwcaps & HWCAP_PACA = 0" in this case.

Probably your way is consistent as other tests in arm64 also just
skips due to HWCAP mismatch.

> 

WARNING: multiple messages have this Message-ID (diff)
From: Amit Kachhap <amit.kachhap@arm.com>
To: Mark Brown <broonie@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,  Shuah Khan <shuah@kernel.org>,
	Boyan Karatotev <boyan.karatotev@arm.com>,
	 linux-arm-kernel@lists.infradead.org,
	linux-kselftest@vger.kernel.org
Subject: Re: [PATCH] kselftest/arm64: pac: Fix skipping of tests on systems without PAC
Date: Fri, 20 Aug 2021 17:05:05 +0530	[thread overview]
Message-ID: <20d96c3e-36f8-276f-ab02-daf5bc7c976f@arm.com> (raw)
In-Reply-To: <20210820105531.GP4177@sirena.org.uk>



On 8/20/21 4:25 PM, Mark Brown wrote:
> On Fri, Aug 20, 2021 at 12:39:39PM +0530, Amit Kachhap wrote:
>> On 8/19/21 10:27 PM, Mark Brown wrote:
> 
>>> -	ASSERT_NE(0, hwcaps & HWCAP_PACA) TH_LOG("PAUTH not enabled"); \
>>> +	if (!(hwcaps & HWCAP_PACA))					\
>>> +		SKIP(return, "PAUTH not enabled"); \
>>>    } while (0)
>>>    #define ASSERT_GENERIC_PAUTH_ENABLED() \
> 
>> May be ASSERT_GENERIC_PAUTH_ENABLED can be replaced with
>> something like VERIFY_GENERIC_PAUTH_ENABLED
> 
> I thought briefly about bikeshedding the name but didn't come up with
> anything that was sufficiently better/clearer.
> 
>> or can be modified like below and instead of failing it skips with a
>> message
> 
>>    -	ASSERT_NE(0, hwcaps & HWCAP_PACA) TH_LOG("PAUTH not enabled"); \
>>    +	ASSERT_NE(0, hwcaps & HWCAP_PACA) SKIP(return, "PAUTH not enabled");
> 
> That's what the patch does?

Agree, I saw few other testcases where ASSERT is used along with SKIP.
(tools/testing/selftests/core/close_range_test.c) so this way 
ASSERT_GENERIC_* macro will be clear. There will be just an extra
log like "hwcaps & HWCAP_PACA = 0" in this case.

Probably your way is consistent as other tests in arm64 also just
skips due to HWCAP mismatch.

> 

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

  reply	other threads:[~2021-08-20 11:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-19 16:57 [PATCH] kselftest/arm64: pac: Fix skipping of tests on systems without PAC Mark Brown
2021-08-19 16:57 ` Mark Brown
2021-08-20  7:09 ` Amit Kachhap
2021-08-20  7:09   ` Amit Kachhap
2021-08-20 10:55   ` Mark Brown
2021-08-20 10:55     ` Mark Brown
2021-08-20 11:35     ` Amit Kachhap [this message]
2021-08-20 11:35       ` Amit Kachhap
2021-08-20 12:00       ` Mark Brown
2021-08-20 12:00         ` Mark Brown
2021-08-20 16:57 ` Catalin Marinas
2021-08-20 16:57   ` 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=20d96c3e-36f8-276f-ab02-daf5bc7c976f@arm.com \
    --to=amit.kachhap@arm.com \
    --cc=boyan.karatotev@arm.com \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.