All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kselftest/arm64: pac: Fix skipping of tests on systems without PAC
@ 2021-08-19 16:57 ` Mark Brown
  0 siblings, 0 replies; 12+ messages in thread
From: Mark Brown @ 2021-08-19 16:57 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Shuah Khan
  Cc: Boyan Karatotev, Amit Daniel Kachhap, linux-arm-kernel,
	linux-kselftest, Mark Brown

The PAC tests check to see if the system supports the relevant PAC features
but instead of skipping the tests if they can't be executed they fail the
tests which makes things look like they're not working when they are.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
 tools/testing/selftests/arm64/pauth/pac.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/tools/testing/selftests/arm64/pauth/pac.c b/tools/testing/selftests/arm64/pauth/pac.c
index 592fe538506e..b743daa772f5 100644
--- a/tools/testing/selftests/arm64/pauth/pac.c
+++ b/tools/testing/selftests/arm64/pauth/pac.c
@@ -25,13 +25,15 @@
 do { \
 	unsigned long hwcaps = getauxval(AT_HWCAP); \
 	/* data key instructions are not in NOP space. This prevents a SIGILL */ \
-	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() \
 do { \
 	unsigned long hwcaps = getauxval(AT_HWCAP); \
 	/* generic key instructions are not in NOP space. This prevents a SIGILL */ \
-	ASSERT_NE(0, hwcaps & HWCAP_PACG) TH_LOG("Generic PAUTH not enabled"); \
+	if (!(hwcaps & HWCAP_PACG)) \
+		SKIP(return, "Generic PAUTH not enabled");	\
 } while (0)
 
 void sign_specific(struct signatures *sign, size_t val)
@@ -256,7 +258,7 @@ TEST(single_thread_different_keys)
 	unsigned long hwcaps = getauxval(AT_HWCAP);
 
 	/* generic and data key instructions are not in NOP space. This prevents a SIGILL */
-	ASSERT_NE(0, hwcaps & HWCAP_PACA) TH_LOG("PAUTH not enabled");
+	ASSERT_PAUTH_ENABLED();
 	if (!(hwcaps & HWCAP_PACG)) {
 		TH_LOG("WARNING: Generic PAUTH not enabled. Skipping generic key checks");
 		nkeys = NKEYS - 1;
@@ -299,7 +301,7 @@ TEST(exec_changed_keys)
 	unsigned long hwcaps = getauxval(AT_HWCAP);
 
 	/* generic and data key instructions are not in NOP space. This prevents a SIGILL */
-	ASSERT_NE(0, hwcaps & HWCAP_PACA) TH_LOG("PAUTH not enabled");
+	ASSERT_PAUTH_ENABLED();
 	if (!(hwcaps & HWCAP_PACG)) {
 		TH_LOG("WARNING: Generic PAUTH not enabled. Skipping generic key checks");
 		nkeys = NKEYS - 1;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH] kselftest/arm64: pac: Fix skipping of tests on systems without PAC
@ 2021-08-19 16:57 ` Mark Brown
  0 siblings, 0 replies; 12+ messages in thread
From: Mark Brown @ 2021-08-19 16:57 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Shuah Khan
  Cc: Boyan Karatotev, Amit Daniel Kachhap, linux-arm-kernel,
	linux-kselftest, Mark Brown

The PAC tests check to see if the system supports the relevant PAC features
but instead of skipping the tests if they can't be executed they fail the
tests which makes things look like they're not working when they are.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
 tools/testing/selftests/arm64/pauth/pac.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/tools/testing/selftests/arm64/pauth/pac.c b/tools/testing/selftests/arm64/pauth/pac.c
index 592fe538506e..b743daa772f5 100644
--- a/tools/testing/selftests/arm64/pauth/pac.c
+++ b/tools/testing/selftests/arm64/pauth/pac.c
@@ -25,13 +25,15 @@
 do { \
 	unsigned long hwcaps = getauxval(AT_HWCAP); \
 	/* data key instructions are not in NOP space. This prevents a SIGILL */ \
-	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() \
 do { \
 	unsigned long hwcaps = getauxval(AT_HWCAP); \
 	/* generic key instructions are not in NOP space. This prevents a SIGILL */ \
-	ASSERT_NE(0, hwcaps & HWCAP_PACG) TH_LOG("Generic PAUTH not enabled"); \
+	if (!(hwcaps & HWCAP_PACG)) \
+		SKIP(return, "Generic PAUTH not enabled");	\
 } while (0)
 
 void sign_specific(struct signatures *sign, size_t val)
@@ -256,7 +258,7 @@ TEST(single_thread_different_keys)
 	unsigned long hwcaps = getauxval(AT_HWCAP);
 
 	/* generic and data key instructions are not in NOP space. This prevents a SIGILL */
-	ASSERT_NE(0, hwcaps & HWCAP_PACA) TH_LOG("PAUTH not enabled");
+	ASSERT_PAUTH_ENABLED();
 	if (!(hwcaps & HWCAP_PACG)) {
 		TH_LOG("WARNING: Generic PAUTH not enabled. Skipping generic key checks");
 		nkeys = NKEYS - 1;
@@ -299,7 +301,7 @@ TEST(exec_changed_keys)
 	unsigned long hwcaps = getauxval(AT_HWCAP);
 
 	/* generic and data key instructions are not in NOP space. This prevents a SIGILL */
-	ASSERT_NE(0, hwcaps & HWCAP_PACA) TH_LOG("PAUTH not enabled");
+	ASSERT_PAUTH_ENABLED();
 	if (!(hwcaps & HWCAP_PACG)) {
 		TH_LOG("WARNING: Generic PAUTH not enabled. Skipping generic key checks");
 		nkeys = NKEYS - 1;
-- 
2.20.1


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

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH] kselftest/arm64: pac: Fix skipping of tests on systems without PAC
  2021-08-19 16:57 ` Mark Brown
@ 2021-08-20  7:09   ` Amit Kachhap
  -1 siblings, 0 replies; 12+ messages in thread
From: Amit Kachhap @ 2021-08-20  7:09 UTC (permalink / raw)
  To: Mark Brown, Catalin Marinas, Will Deacon, Shuah Khan
  Cc: Boyan Karatotev, linux-arm-kernel, linux-kselftest



On 8/19/21 10:27 PM, Mark Brown wrote:
> The PAC tests check to see if the system supports the relevant PAC features
> but instead of skipping the tests if they can't be executed they fail the
> tests which makes things look like they're not working when they are.
> 
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---
>   tools/testing/selftests/arm64/pauth/pac.c | 10 ++++++----
>   1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/testing/selftests/arm64/pauth/pac.c b/tools/testing/selftests/arm64/pauth/pac.c
> index 592fe538506e..b743daa772f5 100644
> --- a/tools/testing/selftests/arm64/pauth/pac.c
> +++ b/tools/testing/selftests/arm64/pauth/pac.c
> @@ -25,13 +25,15 @@
>   do { \
>   	unsigned long hwcaps = getauxval(AT_HWCAP); \
>   	/* data key instructions are not in NOP space. This prevents a SIGILL */ \
> -	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

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"); \					


>   do { \
>   	unsigned long hwcaps = getauxval(AT_HWCAP); \
>   	/* generic key instructions are not in NOP space. This prevents a SIGILL */ \
> -	ASSERT_NE(0, hwcaps & HWCAP_PACG) TH_LOG("Generic PAUTH not enabled"); \
> +	if (!(hwcaps & HWCAP_PACG)) \
> +		SKIP(return, "Generic PAUTH not enabled");	\
>   } while (0)
>   
>   void sign_specific(struct signatures *sign, size_t val)
> @@ -256,7 +258,7 @@ TEST(single_thread_different_keys)
>   	unsigned long hwcaps = getauxval(AT_HWCAP);
>   
>   	/* generic and data key instructions are not in NOP space. This prevents a SIGILL */
> -	ASSERT_NE(0, hwcaps & HWCAP_PACA) TH_LOG("PAUTH not enabled");
> +	ASSERT_PAUTH_ENABLED();
>   	if (!(hwcaps & HWCAP_PACG)) {
>   		TH_LOG("WARNING: Generic PAUTH not enabled. Skipping generic key checks");
>   		nkeys = NKEYS - 1;
> @@ -299,7 +301,7 @@ TEST(exec_changed_keys)
>   	unsigned long hwcaps = getauxval(AT_HWCAP);
>   
>   	/* generic and data key instructions are not in NOP space. This prevents a SIGILL */
> -	ASSERT_NE(0, hwcaps & HWCAP_PACA) TH_LOG("PAUTH not enabled");
> +	ASSERT_PAUTH_ENABLED();
>   	if (!(hwcaps & HWCAP_PACG)) {
>   		TH_LOG("WARNING: Generic PAUTH not enabled. Skipping generic key checks");
>   		nkeys = NKEYS - 1;
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] kselftest/arm64: pac: Fix skipping of tests on systems without PAC
@ 2021-08-20  7:09   ` Amit Kachhap
  0 siblings, 0 replies; 12+ messages in thread
From: Amit Kachhap @ 2021-08-20  7:09 UTC (permalink / raw)
  To: Mark Brown, Catalin Marinas, Will Deacon, Shuah Khan
  Cc: Boyan Karatotev, linux-arm-kernel, linux-kselftest



On 8/19/21 10:27 PM, Mark Brown wrote:
> The PAC tests check to see if the system supports the relevant PAC features
> but instead of skipping the tests if they can't be executed they fail the
> tests which makes things look like they're not working when they are.
> 
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---
>   tools/testing/selftests/arm64/pauth/pac.c | 10 ++++++----
>   1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/testing/selftests/arm64/pauth/pac.c b/tools/testing/selftests/arm64/pauth/pac.c
> index 592fe538506e..b743daa772f5 100644
> --- a/tools/testing/selftests/arm64/pauth/pac.c
> +++ b/tools/testing/selftests/arm64/pauth/pac.c
> @@ -25,13 +25,15 @@
>   do { \
>   	unsigned long hwcaps = getauxval(AT_HWCAP); \
>   	/* data key instructions are not in NOP space. This prevents a SIGILL */ \
> -	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

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"); \					


>   do { \
>   	unsigned long hwcaps = getauxval(AT_HWCAP); \
>   	/* generic key instructions are not in NOP space. This prevents a SIGILL */ \
> -	ASSERT_NE(0, hwcaps & HWCAP_PACG) TH_LOG("Generic PAUTH not enabled"); \
> +	if (!(hwcaps & HWCAP_PACG)) \
> +		SKIP(return, "Generic PAUTH not enabled");	\
>   } while (0)
>   
>   void sign_specific(struct signatures *sign, size_t val)
> @@ -256,7 +258,7 @@ TEST(single_thread_different_keys)
>   	unsigned long hwcaps = getauxval(AT_HWCAP);
>   
>   	/* generic and data key instructions are not in NOP space. This prevents a SIGILL */
> -	ASSERT_NE(0, hwcaps & HWCAP_PACA) TH_LOG("PAUTH not enabled");
> +	ASSERT_PAUTH_ENABLED();
>   	if (!(hwcaps & HWCAP_PACG)) {
>   		TH_LOG("WARNING: Generic PAUTH not enabled. Skipping generic key checks");
>   		nkeys = NKEYS - 1;
> @@ -299,7 +301,7 @@ TEST(exec_changed_keys)
>   	unsigned long hwcaps = getauxval(AT_HWCAP);
>   
>   	/* generic and data key instructions are not in NOP space. This prevents a SIGILL */
> -	ASSERT_NE(0, hwcaps & HWCAP_PACA) TH_LOG("PAUTH not enabled");
> +	ASSERT_PAUTH_ENABLED();
>   	if (!(hwcaps & HWCAP_PACG)) {
>   		TH_LOG("WARNING: Generic PAUTH not enabled. Skipping generic key checks");
>   		nkeys = NKEYS - 1;
> 

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] kselftest/arm64: pac: Fix skipping of tests on systems without PAC
  2021-08-20  7:09   ` Amit Kachhap
@ 2021-08-20 10:55     ` Mark Brown
  -1 siblings, 0 replies; 12+ messages in thread
From: Mark Brown @ 2021-08-20 10:55 UTC (permalink / raw)
  To: Amit Kachhap
  Cc: Catalin Marinas, Will Deacon, Shuah Khan, Boyan Karatotev,
	linux-arm-kernel, linux-kselftest

[-- Attachment #1: Type: text/plain, Size: 806 bytes --]

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?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] kselftest/arm64: pac: Fix skipping of tests on systems without PAC
@ 2021-08-20 10:55     ` Mark Brown
  0 siblings, 0 replies; 12+ messages in thread
From: Mark Brown @ 2021-08-20 10:55 UTC (permalink / raw)
  To: Amit Kachhap
  Cc: Catalin Marinas, Will Deacon, Shuah Khan, Boyan Karatotev,
	linux-arm-kernel, linux-kselftest


[-- Attachment #1.1: Type: text/plain, Size: 806 bytes --]

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?

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] kselftest/arm64: pac: Fix skipping of tests on systems without PAC
  2021-08-20 10:55     ` Mark Brown
@ 2021-08-20 11:35       ` Amit Kachhap
  -1 siblings, 0 replies; 12+ messages in thread
From: Amit Kachhap @ 2021-08-20 11:35 UTC (permalink / raw)
  To: Mark Brown
  Cc: Catalin Marinas, Will Deacon, Shuah Khan, Boyan Karatotev,
	linux-arm-kernel, linux-kselftest



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.

> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] kselftest/arm64: pac: Fix skipping of tests on systems without PAC
@ 2021-08-20 11:35       ` Amit Kachhap
  0 siblings, 0 replies; 12+ messages in thread
From: Amit Kachhap @ 2021-08-20 11:35 UTC (permalink / raw)
  To: Mark Brown
  Cc: Catalin Marinas, Will Deacon, Shuah Khan, Boyan Karatotev,
	linux-arm-kernel, linux-kselftest



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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] kselftest/arm64: pac: Fix skipping of tests on systems without PAC
  2021-08-20 11:35       ` Amit Kachhap
@ 2021-08-20 12:00         ` Mark Brown
  -1 siblings, 0 replies; 12+ messages in thread
From: Mark Brown @ 2021-08-20 12:00 UTC (permalink / raw)
  To: Amit Kachhap
  Cc: Catalin Marinas, Will Deacon, Shuah Khan, Boyan Karatotev,
	linux-arm-kernel, linux-kselftest

[-- Attachment #1: Type: text/plain, Size: 1036 bytes --]

On Fri, Aug 20, 2021 at 05:05:05PM +0530, Amit Kachhap wrote:
> On 8/20/21 4:25 PM, Mark Brown wrote:
> > On Fri, Aug 20, 2021 at 12:39:39PM +0530, Amit Kachhap wrote:

> > >    -	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.

I'm not 100% sure I follow what you're saying here?  I don't see a log
message saying "hwcaps & HWCAP_PACA = 0" on non-PAC systems, or is that
what you're saying you want to see?

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

Right, we can't usefully run tests for features not present in the
system - this sort of thing is the intent of the kselftest skip feature.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] kselftest/arm64: pac: Fix skipping of tests on systems without PAC
@ 2021-08-20 12:00         ` Mark Brown
  0 siblings, 0 replies; 12+ messages in thread
From: Mark Brown @ 2021-08-20 12:00 UTC (permalink / raw)
  To: Amit Kachhap
  Cc: Catalin Marinas, Will Deacon, Shuah Khan, Boyan Karatotev,
	linux-arm-kernel, linux-kselftest


[-- Attachment #1.1: Type: text/plain, Size: 1036 bytes --]

On Fri, Aug 20, 2021 at 05:05:05PM +0530, Amit Kachhap wrote:
> On 8/20/21 4:25 PM, Mark Brown wrote:
> > On Fri, Aug 20, 2021 at 12:39:39PM +0530, Amit Kachhap wrote:

> > >    -	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.

I'm not 100% sure I follow what you're saying here?  I don't see a log
message saying "hwcaps & HWCAP_PACA = 0" on non-PAC systems, or is that
what you're saying you want to see?

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

Right, we can't usefully run tests for features not present in the
system - this sort of thing is the intent of the kselftest skip feature.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] kselftest/arm64: pac: Fix skipping of tests on systems without PAC
  2021-08-19 16:57 ` Mark Brown
@ 2021-08-20 16:57   ` Catalin Marinas
  -1 siblings, 0 replies; 12+ messages in thread
From: Catalin Marinas @ 2021-08-20 16:57 UTC (permalink / raw)
  To: Mark Brown, Will Deacon, Shuah Khan
  Cc: Amit Daniel Kachhap, linux-arm-kernel, Boyan Karatotev, linux-kselftest

On Thu, 19 Aug 2021 17:57:23 +0100, Mark Brown wrote:
> The PAC tests check to see if the system supports the relevant PAC features
> but instead of skipping the tests if they can't be executed they fail the
> tests which makes things look like they're not working when they are.

Applied to arm64 (for-next/kselftest), thanks!

[1/1] kselftest/arm64: pac: Fix skipping of tests on systems without PAC
      https://git.kernel.org/arm64/c/0c69bd2ca6ee

-- 
Catalin


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] kselftest/arm64: pac: Fix skipping of tests on systems without PAC
@ 2021-08-20 16:57   ` Catalin Marinas
  0 siblings, 0 replies; 12+ messages in thread
From: Catalin Marinas @ 2021-08-20 16:57 UTC (permalink / raw)
  To: Mark Brown, Will Deacon, Shuah Khan
  Cc: Amit Daniel Kachhap, linux-arm-kernel, Boyan Karatotev, linux-kselftest

On Thu, 19 Aug 2021 17:57:23 +0100, Mark Brown wrote:
> The PAC tests check to see if the system supports the relevant PAC features
> but instead of skipping the tests if they can't be executed they fail the
> tests which makes things look like they're not working when they are.

Applied to arm64 (for-next/kselftest), thanks!

[1/1] kselftest/arm64: pac: Fix skipping of tests on systems without PAC
      https://git.kernel.org/arm64/c/0c69bd2ca6ee

-- 
Catalin


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

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-08-20 16:59 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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.