From: Stephen Bertram <sbertram@redhat.com>
To: linux-arm-kernel@lists.infradead.org
Cc: Stephen Bertram <sbertram@redhat.com>, linux-kselftest@vger.kernel.org
Subject: [PATCH] kselftest/arm64/pauth: Scale exec_changed_keys on KSFT_MACHINE_SLOW
Date: Fri, 10 Jul 2026 17:59:59 -0400 [thread overview]
Message-ID: <20260710220018.719573-1-sbertram@redhat.com> (raw)
exec_changed_keys performs a fork+exec per PAC_COLLISION_ATTEMPTS
iteration. After raising the default to 1000, the test exceeds the
30s kselftest harness timeout on debug kernels. Use a reduced
iteration count when KSFT_MACHINE_SLOW=yes, consistent with other
kselftests slow-machine handling.
Signed-off-by: Stephen Bertram <sbertram@redhat.com>
---
tools/testing/selftests/arm64/pauth/pac.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/arm64/pauth/pac.c b/tools/testing/selftests/arm64/pauth/pac.c
index f4b859c75a5a..fb9a1e9f8491 100644
--- a/tools/testing/selftests/arm64/pauth/pac.c
+++ b/tools/testing/selftests/arm64/pauth/pac.c
@@ -14,6 +14,8 @@
#include "helper.h"
#define PAC_COLLISION_ATTEMPTS 1000
+/* exec_changed_keys is fork+exec heavy; scale down on slow machines. */
+#define PAC_SLOW_MACHINE_COLLISION_ATTEMPTS 250
/*
* The kernel sets TBID by default. So bits 55 and above should remain
* untouched no matter what.
@@ -36,6 +38,16 @@ do { \
SKIP(return, "Generic PAUTH not enabled"); \
} while (0)
+static inline int pac_collision_attempts(void)
+{
+ const char *slow = getenv("KSFT_MACHINE_SLOW");
+
+ if (slow && !strcmp(slow, "yes"))
+ return PAC_SLOW_MACHINE_COLLISION_ATTEMPTS;
+
+ return PAC_COLLISION_ATTEMPTS;
+}
+
void sign_specific(struct signatures *sign, size_t val)
{
sign->keyia = keyia_sign(val);
@@ -301,6 +313,7 @@ TEST(exec_changed_keys)
int ret;
int same = 10;
int nkeys = NKEYS;
+ int attempts = pac_collision_attempts();
unsigned long hwcaps = getauxval(AT_HWCAP);
/* generic and data key instructions are not in NOP space. This prevents a SIGILL */
@@ -309,8 +322,7 @@ TEST(exec_changed_keys)
TH_LOG("WARNING: Generic PAUTH not enabled. Skipping generic key checks");
nkeys = NKEYS - 1;
}
-
- for (int i = 0; i < PAC_COLLISION_ATTEMPTS; i++) {
+ for (int i = 0; i < attempts; i++) {
ret = exec_sign_all(&new_keys, i);
ASSERT_EQ(0, ret) TH_LOG("failed to run worker");
--
2.54.0
reply other threads:[~2026-07-10 22:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260710220018.719573-1-sbertram@redhat.com \
--to=sbertram@redhat.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kselftest@vger.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