From: Amit Kachhap <amit.kachhap@arm.com> To: Mark Brown <broonie@kernel.org>, Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>, Shuah Khan <shuah@kernel.org> Cc: 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 12:39:39 +0530 [thread overview] Message-ID: <a988b3e2-5f88-fbd5-99da-2066a65a17b2@arm.com> (raw) In-Reply-To: <20210819165723.43903-1-broonie@kernel.org> 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; >
WARNING: multiple messages have this Message-ID (diff)
From: Amit Kachhap <amit.kachhap@arm.com> To: Mark Brown <broonie@kernel.org>, Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>, Shuah Khan <shuah@kernel.org> Cc: 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 12:39:39 +0530 [thread overview] Message-ID: <a988b3e2-5f88-fbd5-99da-2066a65a17b2@arm.com> (raw) In-Reply-To: <20210819165723.43903-1-broonie@kernel.org> 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
next prev parent reply other threads:[~2021-08-20 7:09 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 [this message] 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
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=a988b3e2-5f88-fbd5-99da-2066a65a17b2@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: linkBe 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.