mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Magnus Lindholm <linmag7@gmail.com>
To: richard.henderson@linaro.org, mattst88@gmail.com,
	linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org
Cc: linmag7@gmail.com
Subject: [PATCH 00/14] alpha: fix entry bugs and consolidate generic helpers
Date: Tue,  3 Nov 2026 22:35:06 +0100	[thread overview]
Message-ID: <20261103214120.1099893-1-linmag7@gmail.com> (raw)

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

             reply	other threads:[~2026-11-03 21:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-03 21:35 Magnus Lindholm [this message]
2026-11-03 21:35 ` [PATCH 01/14] alpha: fix saved registers in page-fault oops dumps Magnus Lindholm
2026-11-03 21:35 ` [PATCH 02/14] alpha: report syscall errors correctly to audit Magnus Lindholm
2026-11-03 21:35 ` [PATCH 03/14] alpha: preserve rolled-back registers for SIGSYS Magnus Lindholm
2026-11-03 21:35 ` [PATCH 04/14] alpha: fix syscall restart eligibility Magnus Lindholm
2026-11-03 21:35 ` [PATCH 05/14] alpha: distinguish skipped syscalls from invalid numbers Magnus Lindholm
2026-11-03 21:35 ` [PATCH 06/14] alpha: dispatch system calls from C Magnus Lindholm
2026-11-03 21:35 ` [PATCH 07/14] alpha: use generic entry helpers for interrupts and exceptions Magnus Lindholm
2026-11-03 21:35 ` [PATCH 08/14] alpha: use generic syscall exit for new tasks Magnus Lindholm
2026-11-03 21:35 ` [PATCH 09/14] alpha: remove obsolete core dump register hooks Magnus Lindholm
2026-11-03 21:35 ` [PATCH 10/14] alpha: use generic syscall audit classification Magnus Lindholm
2026-11-03 21:35 ` [PATCH 11/14] alpha: use generic ptrace memory writes Magnus Lindholm
2026-11-03 21:35 ` [PATCH 12/14] alpha: use memparse for memory size options Magnus Lindholm
2026-11-03 21:35 ` [PATCH 13/14] alpha: use generic getrusage for OSF resource accounting Magnus Lindholm
2026-11-03 21:35 ` [PATCH 14/14] alpha: use generic CPU device registration Magnus Lindholm

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=20261103214120.1099893-1-linmag7@gmail.com \
    --to=linmag7@gmail.com \
    --cc=linux-alpha@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mattst88@gmail.com \
    --cc=richard.henderson@linaro.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

all inboxes | Powered by JetHome®