linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] powerpc: change syscall error return scheme
@ 2025-01-29 13:21 Nicholas Piggin
  2025-01-29 13:21 ` [RFC PATCH 1/2] powerpc/signal: Clean up pt_regs access Nicholas Piggin
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Nicholas Piggin @ 2025-01-29 13:21 UTC (permalink / raw)
  To: Dmitry V. Levin
  Cc: Nicholas Piggin, Oleg Nesterov, Eugene Syromyatnikov,
	Mike Frysinger, Renzo Davoli, Davide Berardi, strace-devel,
	Madhavan Srinivasan, Christophe Leroy, linuxppc-dev, linux-kernel

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



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-01-29 14:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-29 13:21 [RFC PATCH 0/2] powerpc: change syscall error return scheme Nicholas Piggin
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

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).