tools/testing/selftests/seccomp/seccomp_bpf.c | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+)
Enable seccomp_bpf selftests on the Alpha architecture by providing
Alpha-specific register definitions and syscall accessors.
This allows the seccomp-bpf test suite to exercise syscall tracing,
seccomp filters, and user notification on Alpha.
Signed-off-by: Magnus Lindholm <linmag7@gmail.com>
---
tools/testing/selftests/seccomp/seccomp_bpf.c | 29 +++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c
index 32e2d4df397b..db2c81bb89b6 100644
--- a/tools/testing/selftests/seccomp/seccomp_bpf.c
+++ b/tools/testing/selftests/seccomp/seccomp_bpf.c
@@ -136,6 +136,8 @@ struct seccomp_data {
# define __NR_seccomp 354
# elif defined(__x86_64__)
# define __NR_seccomp 317
+# elif defined(__alpha__)
+# define __NR_seccomp 514
# elif defined(__arm__)
# define __NR_seccomp 383
# elif defined(__aarch64__)
@@ -1748,6 +1750,29 @@ TEST_F(TRACE_poke, getpid_runs_normally)
# define ARCH_REGS struct user_regs_struct
# define SYSCALL_NUM(_regs) (_regs).orig_eax
# define SYSCALL_RET(_regs) (_regs).eax
+#elif defined(__alpha__)
+#define ARCH_REGS struct pt_regs
+#define SYSCALL_NUM(_regs) ((_regs).r1)
+#define SYSCALL_NR_SET(_regs, _nr) \
+ ((_regs).r1 = (unsigned long)(_nr))
+#define SYSCALL_RET(_regs) ((_regs).r0)
+/*
+ * Alpha syscall ABI:
+ * - r0 holds return value (or positive errno on failure)
+ * - r19 (a3) is 0 on success, 1 on failure
+ */
+#define SYSCALL_RET_SET(_regs, _val) \
+ do { \
+ long __v = (long)(_val); \
+ if (__v < 0) { \
+ (_regs).r0 = (unsigned long)(-__v); \
+ (_regs).r19 = 1; \
+ } else { \
+ (_regs).r0 = (unsigned long)__v; \
+ (_regs).r19 = 0; \
+ } \
+ } while (0)
+
#elif defined(__arm__)
# define ARCH_REGS struct pt_regs
# define SYSCALL_NUM(_regs) (_regs).ARM_r7
@@ -4643,6 +4668,10 @@ TEST(user_notification_wait_killable_pre_notification)
pid_t pid;
long ret;
char c;
+
+ #if defined(__alpha__)
+ SKIP(return, "/proc/<pid>/syscall not available on Alpha");
+ #endif
/* 100 ms */
struct timespec delay = { .tv_nsec = 100000000 };
--
2.52.0
On Tue, Feb 03, 2026 at 07:33:26AM +0100, Magnus Lindholm wrote: > Enable seccomp_bpf selftests on the Alpha architecture by providing > Alpha-specific register definitions and syscall accessors. > > This allows the seccomp-bpf test suite to exercise syscall tracing, > seccomp filters, and user notification on Alpha. > > Signed-off-by: Magnus Lindholm <linmag7@gmail.com> Great! Thanks for doing this. How did you test it? -Kees -- Kees Cook
> > Great! Thanks for doing this. How did you test it? > I have a kernel patch ready with SECCOMP support for Alpha, I'm doing some clean-up work before posting it. I'll have it posted soon. # PASSED: 111 / 111 tests passed. # 13 skipped test(s) detected. Consider enabling relevant config # options to improve coverage. # Totals: pass:98 fail:0 xfail:0 xpass:0 skip:13 error:0 ds10 ~ # ds10 ~ # uname -a Linux ds10 6.19.0-rc6-00087-g8f403dd8d03b-dirty #121 SMP Wed Feb 4 23:20:21 CET 2026 alpha EV67 Tsunami GNU/Linux Magnus > -- > Kees Cook
© 2016 - 2026 Red Hat, Inc.