From: Nicholas Piggin <npiggin@gmail.com>
To: "Dmitry V. Levin" <ldv@strace.io>
Cc: Nicholas Piggin <npiggin@gmail.com>,
Oleg Nesterov <oleg@redhat.com>,
Eugene Syromyatnikov <evgsyr@gmail.com>,
Mike Frysinger <vapier@gentoo.org>,
Renzo Davoli <renzo@cs.unibo.it>,
Davide Berardi <berardi.dav@gmail.com>,
strace-devel@lists.strace.io,
Madhavan Srinivasan <maddy@linux.ibm.com>,
Christophe Leroy <christophe.leroy@csgroup.eu>,
linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: [RFC PATCH 0/2] powerpc: change syscall error return scheme
Date: Wed, 29 Jan 2025 23:21:41 +1000 [thread overview]
Message-ID: <20250129132148.301937-1-npiggin@gmail.com> (raw)
Hi,
I've been toying with the seccomp vs syscall return value problems, and
wonder if something like this approach could give us a simpler alternative.
Basically all the core code uses -errno return value, then we convert it
to the powerpc convention at the last minute when returning.
This seems to pass the seccomp_bpf test cases when applied with the set
syscall info ptrace patches
https://lore.kernel.org/lkml/20250113171054.GA589@strace.io/
With patch 1 of that series reverted.
One concern is working out exact details of what tracers can see and
trying to ensure it doesn't break some corner case.
This could possibly be done for the other weird archs too, if it works
out for powerpc
Thanks,
Nick
Nicholas Piggin (2):
powerpc/signal: Clean up pt_regs access
powerpc/syscall: rework syscall return value handling
arch/powerpc/include/asm/ptrace.h | 13 +---
arch/powerpc/include/asm/syscall.h | 31 +--------
arch/powerpc/kernel/interrupt.c | 16 +++--
arch/powerpc/kernel/signal.c | 67 ++++++++++---------
arch/powerpc/kernel/signal_64.c | 5 +-
tools/testing/selftests/seccomp/seccomp_bpf.c | 16 +++++
6 files changed, 69 insertions(+), 79 deletions(-)
--
2.47.1
next reply other threads:[~2025-01-29 13:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-29 13:21 Nicholas Piggin [this message]
2025-01-29 13:21 ` [RFC PATCH 1/2] powerpc/signal: Clean up pt_regs access Nicholas Piggin
2025-01-29 13:21 ` [RFC PATCH 2/2] powerpc/syscall: rework syscall return value handling Nicholas Piggin
2025-01-29 14:15 ` [RFC PATCH 0/2] powerpc: change syscall error return scheme Dmitry V. Levin
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=20250129132148.301937-1-npiggin@gmail.com \
--to=npiggin@gmail.com \
--cc=berardi.dav@gmail.com \
--cc=christophe.leroy@csgroup.eu \
--cc=evgsyr@gmail.com \
--cc=ldv@strace.io \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=oleg@redhat.com \
--cc=renzo@cs.unibo.it \
--cc=strace-devel@lists.strace.io \
--cc=vapier@gentoo.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;
as well as URLs for NNTP newsgroup(s).