Thread (6 messages) 6 messages, 3 authors, 2021-08-20

Re: [PATCH] kselftest/arm64: pac: Fix skipping of tests on systems without PAC

From: Amit Kachhap <hidden>
Date: 2021-08-20 11:45:13
Also in: 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:
quoted
On 8/19/21 10:27 PM, Mark Brown wrote:
quoted
quoted
-	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() \
quoted
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.
quoted
or can be modified like below and instead of failing it skips with a
message
quoted
   -	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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help