[PATCH 00/14] alpha: fix entry bugs and consolidate generic helpers

From: Magnus Lindholm

Date: Tue Nov 03 2026 - 16:46:39 EST


With GENERIC_ENTRY upstream for Alpha, this series moves syscall dispatch
and ordinary interrupt/exception entry and exit into C using generic
helpers, and removes redundant fork, core-dump, audit and ptrace code.
It also reuses generic memory-option parsing, OSF resource accounting
and CPU registration.

The consolidation work and its regression testing uncovered bugs in
saved-register oops reporting, audit return values, SIGSYS register
rollback, syscall restart eligibility and arguments, and handling of
skipped syscalls versus invalid syscall numbers. Patches 1-5 fix those
bugs before patches 6-14 consolidate the code. The fixes remain distinct
commits with their Fixes tags and existing stable Cc tags.

The fixes and consolidation changes exercise the same entry paths and
need coordinated review and regression testing. They are presented
together so reviewers can follow the fixes through the subsequent code
changes. The fixes can still be considered for earlier application or
backporting without taking the consolidation patches.

Patch 5 distinguishes the -1 abort sentinel from other invalid numbers:
explicit cancellation preserves a supplied result, whereas an invalid
number permitted through entry work returns ENOSYS. It tracks supplied
results explicitly, avoiding guesses from r0/a3 contents. This also
preserves small successful values and seccomp results matching the entry
registers. The C conversion in patch 6 retains the corrected behavior.

The OSF accounting change intentionally follows getrusage(2): RUSAGE_SELF
covers the whole thread group, previously zero resource counters are
reported, and CPU times use the generic microsecond conversion rather
than jiffy rounding. The OSF layout and supported selectors are retained.

On stock-PAL QEMU the rebuilt ES40 image passes all 107 skip/result,
91 portable ptrace, 30 skipped-restart and 50 forced-success checks, as
well as SIGSYS rollback, on one and four CPUs. The four-CPU run passes
all 18 regression suites, including seccomp (99 passes, 12 expected
skips). Patch 5 before the C conversion also passed its focused four-CPU
run on the release base.

The complete series passed all 18 regression suites on a three-CPU
EV67 ES40. The resource-accounting test now compares OSF peak RSS
with native waitid() for the same child and accounts for its final
voluntary context switch. Native controls reproduced both the low RSS
reading and the extra context switch. The corrected run had 8,364
concurrent CHILDREN snapshots with no mismatches, and lockdep stayed
enabled.

All eight focused strace injection and syscall-info tests passed. A full
native strace run at 80e661285 had 1,225 passes, 303 skips and seven
failures. Three passed on serial recheck. The remaining four involved
CLOSE_RANGE_EXCEPT, the separately submitted PR_GET_UNALIGN fix, the
Yama hint when running with CAP_SYS_PTRACE, and the getxpid syscall name
on Alpha. The companion ptrace selftest remains separate from the series.

Codex assisted with code, tests and descriptions.

Magnus Lindholm (14):
alpha: fix saved registers in page-fault oops dumps
alpha: report syscall errors correctly to audit
alpha: preserve rolled-back registers for SIGSYS
alpha: fix syscall restart eligibility
alpha: distinguish skipped syscalls from invalid numbers
alpha: dispatch system calls from C
alpha: use generic entry helpers for interrupts and exceptions
alpha: use generic syscall exit for new tasks
alpha: remove obsolete core dump register hooks
alpha: use generic syscall audit classification
alpha: use generic ptrace memory writes
alpha: use memparse for memory size options
alpha: use generic getrusage for OSF resource accounting
alpha: use generic CPU device registration

arch/alpha/Kconfig | 5 +-
arch/alpha/include/asm/elf.h | 7 -
arch/alpha/include/asm/entry-common.h | 11 +-
arch/alpha/include/asm/ptrace.h | 13 +-
arch/alpha/include/asm/syscall.h | 24 +--
arch/alpha/include/asm/thread_info.h | 3 +
arch/alpha/kernel/Makefile | 3 +-
arch/alpha/kernel/asm-offsets.c | 1 -
arch/alpha/kernel/audit.c | 62 -------
arch/alpha/kernel/entry.S | 293 ++++-----------------------------
arch/alpha/kernel/irq.c | 8 +-
arch/alpha/kernel/irq_alpha.c | 41 ++---
arch/alpha/kernel/osf_sys.c | 56 ++-----
arch/alpha/kernel/process.c | 32 ++--
arch/alpha/kernel/proto.h | 16 +-
arch/alpha/kernel/ptrace.c | 48 ++----
arch/alpha/kernel/setup.c | 41 +----
arch/alpha/kernel/signal.c | 151 ++---------------
arch/alpha/kernel/syscall.c | 85 ++++++++++
arch/alpha/kernel/syscalls/syscall.tbl | 10 +-
arch/alpha/kernel/traps.c | 118 ++++++++++---
arch/alpha/mm/fault.c | 27 ++-
22 files changed, 356 insertions(+), 699 deletions(-)

base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
--
2.43.0