Skip to content

alpha: fix entry bugs and consolidate generic helpers

Magnus Lindholm linux-alpha lkml stable 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest14 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/14alpha: fix saved registers in page-fault oops dumpsarch/alpha/mm/fault.c+1 -10 replies
2/14alpha: report syscall errors correctly to auditarch/alpha/include/asm/ptrace.h+11 -20 replies
3/14alpha: preserve rolled-back registers for SIGSYSarch/alpha/include/asm/syscall.h arch/alpha/include/asm/thread_info.h arch/alpha/kernel/signal.c+14 -30 replies
4/14alpha: fix syscall restart eligibilityarch/alpha/include/asm/entry-common.h arch/alpha/kernel/signal.c+20 -30 replies
5/14alpha: distinguish skipped syscalls from invalid numbersarch/alpha/include/asm/syscall.h arch/alpha/include/asm/thread_info.h arch/alpha/kernel/ptrace.c +1 more+19 -460 replies
6/14alpha: dispatch system calls from Carch/alpha/include/asm/syscall.h arch/alpha/include/asm/thread_info.h arch/alpha/kernel/Makefile +6 more+113 -2720 replies
7/14alpha: use generic entry helpers for interrupts and exceptionsarch/alpha/include/asm/entry-common.h arch/alpha/kernel/entry.S arch/alpha/kernel/irq.c +5 more+154 -1920 replies
8/14alpha: use generic syscall exit for new tasksarch/alpha/kernel/entry.S arch/alpha/kernel/process.c arch/alpha/kernel/proto.h +1 more+30 -230 replies
9/14alpha: remove obsolete core dump register hooksarch/alpha/include/asm/elf.h arch/alpha/kernel/process.c arch/alpha/kernel/ptrace.c+3 -350 replies
10/14alpha: use generic syscall audit classificationarch/alpha/Kconfig arch/alpha/kernel/Makefile arch/alpha/kernel/audit.c+0 -670 replies
11/14alpha: use generic ptrace memory writesarch/alpha/kernel/ptrace.c+0 -60 replies
12/14alpha: use memparse for memory size optionsarch/alpha/kernel/setup.c+2 -220 replies
13/14alpha: use generic getrusage for OSF resource accountingarch/alpha/kernel/osf_sys.c+17 -390 replies
14/14alpha: use generic CPU device registrationarch/alpha/Kconfig arch/alpha/kernel/setup.c+1 -170 replies

Reviews trailers per patch

None of the 14 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchMatt Turner
SeriesT-b R-b
1/14
2/14
3/14
4/14
5/14
6/14
7/14
8/14
9/14
10/14
11/14
12/14
13/14
14/14

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

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

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

Signature · 1 line
2.43.0