[PATCH] uapi: fix asm/signal.h userspace compilation errors

2017-02-25 Thread Dmitry V. Levin
n32, however, #include seems to be the most straightforward way to obtain the definition for sigaltstack.ss_size's type. Signed-off-by: Dmitry V. Levin <l...@altlinux.org> --- include/uapi/asm-generic/signal.h | 3 +++ arch/alpha/include/uapi/asm/signal.h | 3 +++ arch/arm/include

[PATCH v2] uapi: fix asm/signal.h userspace compilation errors

2017-03-01 Thread Dmitry V. Levin
) < sizeof(__kernel_size_t). Signed-off-by: Dmitry V. Levin <l...@altlinux.org> --- v2: create a separate patch for x86, replace size_t with __kernel_size_t instead of including . include/uapi/asm-generic/signal.h | 2 +- arch/alpha/include/uapi/asm/signal.h | 2 +- arch/arm/include

[PATCH 2/3] uapi: fix asm/sembuf.h userspace compilation errors

2017-03-01 Thread Dmitry V. Levin
' __kernel_ulong_t __unused3; /usr/include/asm/sembuf.h:21:2: error: unknown type name '__kernel_ulong_t' __kernel_ulong_t __unused4; Signed-off-by: Dmitry V. Levin <l...@altlinux.org> --- include/uapi/asm-generic/sembuf.h | 1 + arch/alpha/include/uapi/asm/sembuf.h | 2 ++ arch/avr32/includ

[PATCH 3/3] uapi: fix asm/shmbuf.h userspace compilation errors

2017-03-01 Thread Dmitry V. Levin
: error: unknown type name '__kernel_ulong_t' __kernel_ulong_t __unused3; /usr/include/asm-generic/shmbuf.h:56:2: error: unknown type name '__kernel_ulong_t' __kernel_ulong_t __unused4; Signed-off-by: Dmitry V. Levin <l...@altlinux.org> --- include/uapi/asm-generic/shmbuf.h | 1 + arch

[PATCH 1/3] uapi: fix asm/msgbuf.h userspace compilation errors

2017-03-01 Thread Dmitry V. Levin
'__kernel_ulong_t' __kernel_ulong_t __unused5; Signed-off-by: Dmitry V. Levin <l...@altlinux.org> --- include/uapi/asm-generic/msgbuf.h | 1 + arch/alpha/include/uapi/asm/msgbuf.h | 2 ++ arch/avr32/include/uapi/asm/msgbuf.h | 2 ++ arch/frv/include/uapi/asm/msgbuf.h | 2 ++

[PATCH] uapi: fix another asm/shmbuf.h userspace compilation error

2017-03-01 Thread Dmitry V. Levin
(__kernel_size_t), but as the kernel treats shm_segsz field as __kernel_size_t anyway, UAPI should follow. Thanks to little-endiannes of x32 and 64-bit alignment of the field following shm_segsz, this change doesn't break ABI, and the difference doesn't manifest itself easily. Signed-off-by: Dmitry V

Re: [PATCH] uapi: fix asm/signal.h userspace compilation errors

2017-03-02 Thread Dmitry V. Levin
On Thu, Mar 02, 2017 at 10:22:18AM -0500, Carlos O'Donell wrote: > On Wed, Mar 1, 2017 at 11:20 AM, Arnd Bergmann <a...@arndb.de> wrote: > > On Sun, Feb 26, 2017 at 2:01 AM, Dmitry V. Levin <l...@altlinux.org> wrote: > >> Include (guarded by #ifndef __KERNEL__) to f

ppc compat v4.16 regression: sending SIGTRAP or SIGFPE via kill() returns wrong values in si_pid and si_uid

2018-04-09 Thread Dmitry V. Levin
Hi, There seems to be a regression in v4.16 on ppc compat very similar to sparc compat regression reported earlier at https://marc.info/?l=linux-sparc=151501500704383 . The symptoms are exactly the same: the same signal_receive test from the strace test suite fails with the same diagnostics:

Re: sparc/ppc/arm compat siginfo ABI regressions: sending SIGFPE via kill() returns wrong values in si_pid and si_uid

2018-04-12 Thread Dmitry V. Levin
On Thu, Apr 12, 2018 at 10:58:11AM +0100, Russell King - ARM Linux wrote: > On Thu, Apr 12, 2018 at 04:34:35AM +0300, Dmitry V. Levin wrote: > > A similar commit v4.16-rc1~159^2~37 > > ("signal/arm: Document conflicts with SI_USER and SIGFPE") must have > > intr

Re: sparc/ppc/arm compat siginfo ABI regressions: sending SIGFPE via kill() returns wrong values in si_pid and si_uid

2018-04-12 Thread Dmitry V. Levin
On Thu, Apr 12, 2018 at 01:19:49PM +0100, Russell King - ARM Linux wrote: > On Thu, Apr 12, 2018 at 02:03:14PM +0300, Dmitry V. Levin wrote: > > On Thu, Apr 12, 2018 at 10:58:11AM +0100, Russell King - ARM Linux wrote: > > > On Thu, Apr 12, 2018 at 04:34:35AM +0300, Dmi

Re: sparc/ppc/arm compat siginfo ABI regressions: sending SIGFPE via kill() returns wrong values in si_pid and si_uid

2018-04-12 Thread Dmitry V. Levin
On Thu, Apr 12, 2018 at 09:50:26AM -0700, Linus Torvalds wrote: > Does this attached patch perhaps fix the ARM case? > > It just uses FPE_FLTUNK as the default si_code for SIGFPE, which seems > sane enough. And then gets rid of FPE_FIXME, which should resolve the > nasty case. > > Hmm? Entirely

Re: sparc/ppc/arm compat siginfo ABI regressions: sending SIGFPE via kill() returns wrong values in si_pid and si_uid

2018-04-11 Thread Dmitry V. Levin
Hi, On Mon, Apr 09, 2018 at 06:22:53PM +0300, Dmitry V. Levin wrote: > There seems to be a regression in v4.16 on ppc compat very similar > to sparc compat regression reported earlier at > https://marc.info/?l=linux-sparc=151501500704383 . > > The symptoms are exactly the

[PATCH v7 00/22] ptrace: add PTRACE_GET_SYSCALL_INFO request

2019-01-06 Thread Dmitry V. Levin
ch(). * Use addr argument of sys_ptrace to get expected size of the struct; return full size of the struct. Dmitry V. Levin (21): asm-generic/syscall.h: prepare for inclusion by other files asm-generic/syscall.h: turn syscall_[gs]et_arguments into wrappers alpha: define remaining s

[PATCH v7 20/22] syscall_get_arch: add "struct task_struct *" argument

2019-01-06 Thread Dmitry V. Levin
dev@lists.ozlabs.org Cc: linux-ri...@lists.infradead.org Cc: linux-s...@vger.kernel.org Cc: linux...@vger.kernel.org Cc: sparcli...@vger.kernel.org Cc: linux...@lists.infradead.org Cc: linux-xte...@linux-xtensa.org Cc: linux-a...@vger.kernel.org Cc: linux-au...@redhat.com Signed-off-by: Dmitry

[PATCH v7 16/22] powerpc: define syscall_get_error()

2019-01-06 Thread Dmitry V. Levin
: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Oleg Nesterov Cc: Andy Lutomirski Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Dmitry V. Levin --- Notes: v7: unchanged v6: unchanged v5: This change has been

[PATCH v6 00/27] ptrace: add PTRACE_GET_SYSCALL_INFO request

2018-12-13 Thread Dmitry V. Levin
eturn full size of the struct. Dmitry V. Levin (25): asm-generic/syscall.h: prepare for inclusion by other files asm-generic/syscall.h: turn syscall_[gs]et_arguments into wrappers alpha: define remaining syscall_get_* functions Move EM_ARCOMPACT and EM_ARCV2 to uapi/linux/elf-em.h arc: de

[PATCH] powerpc/ptrace: cleanup do_syscall_trace_enter

2018-12-16 Thread Dmitry V. Levin
Invoke tracehook_report_syscall_entry once. Signed-off-by: Dmitry V. Levin --- arch/powerpc/kernel/ptrace.c | 54 +--- 1 file changed, 31 insertions(+), 23 deletions(-) diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c index 714c3480c52d

Re: [PATCH] powerpc/ptrace: cleanup do_syscall_trace_enter

2018-12-17 Thread Dmitry V. Levin
Hi, On Mon, Dec 17, 2018 at 10:20:26PM +1100, Michael Ellerman wrote: > "Dmitry V. Levin" writes: > > Invoke tracehook_report_syscall_entry once. > > Thanks. > > > Signed-off-by: Dmitry V. Levin > > --- > > arch/powerpc/kernel/ptrace.c | 54 ++

[PATCH v6 24/27] syscall_get_arch: add "struct task_struct *" argument

2018-12-13 Thread Dmitry V. Levin
abs.org Cc: linux-ri...@lists.infradead.org Cc: linux-s...@vger.kernel.org Cc: linux...@vger.kernel.org Cc: sparcli...@vger.kernel.org Cc: linux...@lists.infradead.org Cc: linux-xte...@linux-xtensa.org Cc: linux-a...@vger.kernel.org Cc: linux-au...@redhat.com Signed-off-by: Dmitry V. Levin --- Notes:

[PATCH v6 25/27] powerpc/ptrace: replace ptrace_report_syscall() with a tracehook call

2018-12-13 Thread Dmitry V. Levin
. Co-authored-by: Dmitry V. Levin Fixes: 5521eb4bca2d ("powerpc/ptrace: Add support for PTRACE_SYSEMU") Signed-off-by: Elvira Khabirova Signed-off-by: Dmitry V. Levin [mpe: Take this as a minimal fix for 4.20, we'll rework it later] Signed-off-by: Michael Ellerman --- Not

[PATCH v6 18/27] powerpc: define syscall_get_error()

2018-12-13 Thread Dmitry V. Levin
: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Oleg Nesterov Cc: Andy Lutomirski Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Dmitry V. Levin --- Notes: v6: unchanged v5: This change has been tested

Re: [PATCH v4] powerpc/ptrace: replace ptrace_report_syscall() with a tracehook call

2018-12-07 Thread Dmitry V. Levin
On Fri, Dec 07, 2018 at 10:12:49PM +1100, Michael Ellerman wrote: > "Dmitry V. Levin" writes: > > On Mon, Dec 03, 2018 at 06:18:23AM +0300, Dmitry V. Levin wrote: > >> From: Elvira Khabirova > >> > >> Arch code should use tracehook_*() helpers, a

[PATCH v5] powerpc/ptrace: replace ptrace_report_syscall() with a tracehook call

2018-12-07 Thread Dmitry V. Levin
. Co-authored-by: Dmitry V. Levin Fixes: 5521eb4bca2d ("powerpc/ptrace: Add support for PTRACE_SYSEMU") Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Oleg Nesterov Cc: Breno Leitao Cc: Andy Lutomirski Cc: Eugene Syromyatnikov Cc: linuxppc-dev@lists.ozlabs.

Re: [PATCH v4] powerpc/ptrace: replace ptrace_report_syscall() with a tracehook call

2018-12-07 Thread Dmitry V. Levin
On Fri, Dec 07, 2018 at 05:34:10PM +0100, Oleg Nesterov wrote: > On 12/07, Dmitry V. Levin wrote: > > On Fri, Dec 07, 2018 at 10:12:49PM +1100, Michael Ellerman wrote: > > > > > > Sorry, this patch does not work, please ignore it. > > > > > > Hmm O

[PATCH v6] powerpc/ptrace: replace ptrace_report_syscall() with a tracehook call

2018-12-07 Thread Dmitry V. Levin
From: Elvira Khabirova Arch code should use tracehook_*() helpers, as documented in include/linux/tracehook.h, ptrace_report_syscall() is not expected to be used outside that file. Co-authored-by: Dmitry V. Levin Fixes: 5521eb4bca2d ("powerpc/ptrace: Add support for PTRACE_SYSEMU") C

[PATCH v4] powerpc/ptrace: replace ptrace_report_syscall() with a tracehook call

2018-12-02 Thread Dmitry V. Levin
From: Elvira Khabirova Arch code should use tracehook_*() helpers, as documented in include/linux/tracehook.h, ptrace_report_syscall() is not expected to be used outside that file. Co-authored-by: Dmitry V. Levin Fixes: 5521eb4bca2d ("powerpc/ptrace: Add support for PTRACE_SYSEMU")

Re: [PATCH v4] powerpc/ptrace: replace ptrace_report_syscall() with a tracehook call

2018-12-06 Thread Dmitry V. Levin
On Mon, Dec 03, 2018 at 06:18:23AM +0300, Dmitry V. Levin wrote: > From: Elvira Khabirova > > Arch code should use tracehook_*() helpers, as documented > in include/linux/tracehook.h, > ptrace_report_syscall() is not expected to be used outside that file. > > Co-authore

[PATCH v5 16/25] powerpc: define syscall_get_error()

2018-12-09 Thread Dmitry V. Levin
: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Oleg Nesterov Cc: Andy Lutomirski Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Dmitry V. Levin --- Notes: This change has been tested with tools/testing/selftests/ptrace

[PATCH v5 23/25] powerpc/ptrace: replace ptrace_report_syscall() with a tracehook call

2018-12-09 Thread Dmitry V. Levin
. Co-authored-by: Dmitry V. Levin Fixes: 5521eb4bca2d ("powerpc/ptrace: Add support for PTRACE_SYSEMU") Cc: Michael Ellerman Cc: Oleg Nesterov Cc: Eugene Syromyatnikov Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Breno Leitao Cc: Andy Lutomirski Cc: linuxppc-dev@lists.ozlabs.

[PATCH v5 00/25] ptrace: add PTRACE_GET_SYSCALL_INFO request

2018-12-09 Thread Dmitry V. Levin
v2: * Do not use task->ptrace. * Replace entry_info.is_compat with entry_info.arch, use syscall_get_arch(). * Use addr argument of sys_ptrace to get expected size of the struct; return full size of the struct. Dmitry V. Levin (23): alpha: define remaining syscall_get_*

[PATCH v5 22/25] syscall_get_arch: add "struct task_struct *" argument

2018-12-09 Thread Dmitry V. Levin
.@vger.kernel.org Cc: linux...@vger.kernel.org Cc: sparcli...@vger.kernel.org Cc: linux...@lists.infradead.org Cc: linux-xte...@linux-xtensa.org Cc: linux-a...@vger.kernel.org Cc: linux-au...@redhat.com Signed-off-by: Dmitry V. Levin --- Notes: v5: fixed asm-generic docs by reverting 1002d94d3

Re: [PATCH v6] powerpc/ptrace: replace ptrace_report_syscall() with a tracehook call

2018-12-10 Thread Dmitry V. Levin
On Mon, Dec 10, 2018 at 02:28:07PM +0100, Oleg Nesterov wrote: > On 12/07, Dmitry V. Levin wrote: > > > > Please make either v5 or v6 edition of this fix, or any similar fix, > > into v4.20. > > IIUC, v5 above means > > [PATCH v5 23/25] powerpc/ptra

Re: [PATCH v2 16/15] syscall_get_arch: add "struct task_struct *" argument

2018-11-21 Thread Dmitry V. Levin
Hi Paul, On Wed, Nov 21, 2018 at 06:40:06PM +, Paul Burton wrote: > Hi Dmitry, > > On Wed, Nov 21, 2018 at 03:44:22AM +0300, Dmitry V. Levin wrote: > > This argument is required to extend the generic ptrace API > > with PTRACE_GET_SYSCALL_INFO request: syscal

[PATCH v2 16/15 v2] syscall_get_arch: add "struct task_struct *" argument

2018-11-21 Thread Dmitry V. Levin
Cc: linux...@lists.infradead.org Cc: linux-xte...@linux-xtensa.org Cc: linuxppc-dev@lists.ozlabs.org Cc: nios2-...@lists.rocketboards.org Cc: openr...@lists.librecores.org Cc: sparcli...@vger.kernel.org Cc: uclinux-h8-de...@lists.sourceforge.jp Cc: x...@kernel.org Signed-off-by: Dmitry V. Levin --- v2: clean

[PATCH v2 16/15] syscall_get_arch: add "struct task_struct *" argument

2018-11-20 Thread Dmitry V. Levin
nuxppc-dev@lists.ozlabs.org Cc: nios2-...@lists.rocketboards.org Cc: openr...@lists.librecores.org Cc: sparcli...@vger.kernel.org Cc: uclinux-h8-de...@lists.sourceforge.jp Cc: x...@kernel.org Signed-off-by: Dmitry V. Levin --- arch/alpha/include/asm/syscall.h | 2 +- arch/arc/include/asm/syscall.h

[PATCH v3] powerpc/ptrace: replace ptrace_report_syscall() with a tracehook call

2018-11-19 Thread Dmitry V. Levin
From: Elvira Khabirova Arch code should use tracehook_*() helpers as documented in include/linux/tracehook.h, ptrace_report_syscall() is not expected to be used outside that file. Co-authored-by: Dmitry V. Levin Fixes: 5521eb4bca2d ("powerpc/ptrace: Add support for PTRACE_SYSEMU")

[PATCH 14/14] syscall_get_arch: add "struct task_struct *" argument

2019-01-09 Thread Dmitry V. Levin
.@vger.kernel.org Cc: sparcli...@vger.kernel.org Cc: linux...@lists.infradead.org Cc: linux-xte...@linux-xtensa.org Cc: linux-a...@vger.kernel.org Cc: linux-au...@redhat.com Signed-off-by: Dmitry V. Levin --- arch/alpha/include/asm/syscall.h | 2 +- arch/arc/include/asm/syscall.h

Re: [PATCH 6/6 v3] syscalls: Remove start and number from syscall_set_arguments() args

2019-04-04 Thread Dmitry V. Levin
today, there are no users of syscall_set_arguments(). But we are told that > there will be soon. But for now, at least make it consistent with > syscall_get_arguments(). > > Link: http://lkml.kernel.org/r/20190327222014.ga32...@altlinux.org FWIW, you can add Reviewed-by: Dmitry V. Levin There

Re: [PATCH 5/6 v3] syscalls: Remove start and number from syscall_get_arguments() args

2019-04-04 Thread Dmitry V. Levin
ent cases that are never used, simply rewrite it to return the first 6 > arguments of a system call. > > This should help out the performance of tracing system calls by ptrace, > ftrace and perf. > > Link: http://lkml.kernel.org/r/20161107213233.754809...@goodmis.org FWIW, you c

[PATCH v7 16/22] powerpc: define syscall_get_error()

2019-02-28 Thread Dmitry V. Levin
: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Oleg Nesterov Cc: Andy Lutomirski Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Dmitry V. Levin --- This is just a gentle ping, the patch is unchanged. Notes: v7: unchanged

[PATCH v2 13/13] syscall_get_arch: add "struct task_struct *" argument

2019-03-17 Thread Dmitry V. Levin
.@vger.kernel.org Cc: sparcli...@vger.kernel.org Cc: linux...@lists.infradead.org Cc: linux-xte...@linux-xtensa.org Cc: linux-a...@vger.kernel.org Cc: linux-au...@redhat.com Signed-off-by: Dmitry V. Levin --- Notes: v2: unchanged arch/alpha/include/asm/syscall.h | 2 +- arch/arc/i

Re: [PATCH v2 2/6] ptrace: introduce ptrace_syscall_enter to consolidate PTRACE_SYSEMU handling

2019-03-18 Thread Dmitry V. Levin
On Mon, Mar 18, 2019 at 10:49:21AM +, Sudeep Holla wrote: > Currently each architecture handles PTRACE_SYSEMU in very similar way. > It's completely arch independent and can be handled in the code helping > to consolidate PTRACE_SYSEMU handling. > > Let's introduce a hook

Re: [PATCH v2 2/6] ptrace: introduce ptrace_syscall_enter to consolidate PTRACE_SYSEMU handling

2019-03-18 Thread Dmitry V. Levin
On Mon, Mar 18, 2019 at 10:49:21AM +, Sudeep Holla wrote: > Currently each architecture handles PTRACE_SYSEMU in very similar way. > It's completely arch independent and can be handled in the code helping > to consolidate PTRACE_SYSEMU handling. > > Let's introduce a hook

Re: [PATCH v2 4/6] powerpc: use common ptrace_syscall_enter hook to handle _TIF_SYSCALL_EMU

2019-03-18 Thread Dmitry V. Levin
On Mon, Mar 18, 2019 at 10:49:23AM +, Sudeep Holla wrote: > Now that we have a new hook ptrace_syscall_enter that can be called from > syscall entry code and it handles PTRACE_SYSEMU in generic code, we > can do some cleanup using the same in do_syscall_trace_enter. > > Cc: Oleg Nesterov >

[PATCH linux-next v8 0/7] ptrace: add PTRACE_GET_SYSCALL_INFO request

2019-03-21 Thread Dmitry V. Levin
pat with entry_info.arch, use syscall_get_arch(). * Use addr argument of sys_ptrace to get expected size of the struct; return full size of the struct. Dmitry V. Levin (6): nds32: fix asm/syscall.h hexagon: define syscall_get_error() and syscall_get_return_value() mips: define syscall

[PATCH linux-next v8 5/7] powerpc: define syscall_get_error()

2019-03-21 Thread Dmitry V. Levin
: Michael Ellerman Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Oleg Nesterov Cc: Andy Lutomirski Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Dmitry V. Levin --- Notes: v8: unchanged v7: unchanged v6: unchanged v5: initial

[PATCH linux-next v9 0/7] ptrace: add PTRACE_GET_SYSCALL_INFO request

2019-04-08 Thread Dmitry V. Levin
truct; return full size of the struct. Dmitry V. Levin (6): nds32: fix asm/syscall.h # waiting for ack since early January hexagon: define syscall_get_error() and syscall_get_return_value() # waiting for ack since November mips: define syscall_get_error() # acked parisc: define syscall_get_erro

[PATCH linux-next v9 5/7] powerpc: define syscall_get_error()

2019-04-08 Thread Dmitry V. Levin
: Michael Ellerman Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Oleg Nesterov Cc: Andy Lutomirski Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Dmitry V. Levin --- Michael, this patch is waiting for ACK since early December. Notes: v9

[PATCH linux-next v10 5/7] powerpc: define syscall_get_error()

2019-04-15 Thread Dmitry V. Levin
: Michael Ellerman Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Oleg Nesterov Cc: Andy Lutomirski Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Dmitry V. Levin --- Michael, this patch is waiting for ACK since early December. Notes: v10

[PATCH linux-next v10 0/7] ptrace: add PTRACE_GET_SYSCALL_INFO request

2019-04-15 Thread Dmitry V. Levin
the struct; return full size of the struct. Dmitry V. Levin (6): nds32: fix asm/syscall.h # acked hexagon: define syscall_get_error() and syscall_get_return_value() # waiting for ack since November mips: define syscall_get_error() # acked parisc: define syscall_get_erro

[PATCH v11 0/7] ptrace: add PTRACE_GET_SYSCALL_INFO request

2019-05-10 Thread Dmitry V. Levin
at with entry_info.arch, used syscall_get_arch(). * Used addr argument of sys_ptrace to get expected size of the struct; return full size of the struct. Dmitry V. Levin (6): nds32: fix asm/syscall.h # acked hexagon: define syscall_get_error() and syscall_get_return_value() # waiting for ack

[PATCH v11 5/7] powerpc: define syscall_get_error()

2019-05-10 Thread Dmitry V. Levin
-by: Michael Ellerman Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Oleg Nesterov Cc: Andy Lutomirski Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Dmitry V. Levin --- Notes: v11: added Acked-by from https://lore.kernel.org/lkml

Re: [PATCH v9 08/10] open: openat2(2) syscall

2019-07-18 Thread Dmitry V. Levin
On Sun, Jul 07, 2019 at 12:57:35AM +1000, Aleksa Sarai wrote: [...] > +/** > + * Arguments for how openat2(2) should open the target path. If @extra is > zero, > + * then openat2(2) is identical to openat(2). > + * > + * @flags: O_* flags (unknown flags ignored). What was the rationale for

Re: [PATCH v9 08/10] open: openat2(2) syscall

2019-07-18 Thread Dmitry V. Levin
On Thu, Jul 18, 2019 at 11:29:50PM +0200, Arnd Bergmann wrote: [...] > 5. you get the same problem with seccomp and strace that >clone3() has -- these and others only track the register >arguments by default. Just for the record, this is definitely not the case for strace: it decodes

Re: Linux powerpc new system call instruction and ABI

2021-05-18 Thread Dmitry V. Levin
Hi, On Thu, Jun 11, 2020 at 06:12:01PM +1000, Nicholas Piggin wrote: [...] > - Error handling: The consensus among kernel, glibc, and musl is to move to > using negative return values in r3 rather than CR0[SO]=1 to indicate error, > which matches most other architectures, and is closer to a

Re: Linux powerpc new system call instruction and ABI

2021-05-19 Thread Dmitry V. Levin
On Wed, May 19, 2021 at 12:50:24PM +1000, Nicholas Piggin wrote: [...] > With this patch, I think the ptrace ABI should mostly be fixed. I think > a problem remains with applications that look at system call return > registers directly and have powerpc specific error cases. Those probably > will

Re: Linux powerpc new system call instruction and ABI

2021-05-19 Thread Dmitry V. Levin
On Wed, May 19, 2021 at 08:59:05PM +1000, Nicholas Piggin wrote: > Excerpts from Dmitry V. Levin's message of May 19, 2021 8:24 pm: > > On Wed, May 19, 2021 at 12:50:24PM +1000, Nicholas Piggin wrote: > > [...] > >> With this patch, I think the ptrace ABI should mostly be fixed. I think > >> a

Re: Linux powerpc new system call instruction and ABI

2021-05-19 Thread Dmitry V. Levin
On Thu, May 20, 2021 at 12:45:57PM +1000, Nicholas Piggin wrote: > Excerpts from Dmitry V. Levin's message of May 20, 2021 11:06 am: > > On Wed, May 19, 2021 at 07:48:47PM -0400, Rich Felker wrote: > >> On Wed, May 19, 2021 at 06:09:25PM +, Joakim Tjernlund wrote: > > [...] > >> > W.r.t

Re: Linux powerpc new system call instruction and ABI

2021-05-19 Thread Dmitry V. Levin
On Thu, May 20, 2021 at 12:40:36PM +1000, Nicholas Piggin wrote: [...] > > Looks like struct pt_regs.trap already contains the information that could > > be used to tell 'sc' from 'scv': if (pt_regs.trap & ~0xf) == 0x3000, then > > it's scv. Is my reading of arch/powerpc/include/asm/ptrace.h

Re: [PATCH 2/2] powerpc/64s/syscall: Fix ptrace syscall info with scv syscalls

2021-05-20 Thread Dmitry V. Levin
and tracing functions. > > Fix. tools/testing/selftests/ptrace/get_syscall_info now passes when > scv is used. > > Fixes: 7fa95f9adaee ("powerpc/64s: system call support for scv/rfscv > instructions") > Reported-by: "Dmitry V. Levin" > Signed-off-by: Nichol

Re: [PATCH 1/2] powerpc/64s/syscall: Use pt_regs.trap to distinguish syscall ABI difference between sc and scv syscalls

2021-05-20 Thread Dmitry V. Levin
gt; Document that pt_regs.trap can be used for this, and fix one in-tree user > to work with scv 0 syscalls. > > Fixes: 7fa95f9adaee ("powerpc/64s: system call support for scv/rfscv > instructions") > Reported-by: "Dmitry V. Levin" > Suggested-by: "Dmitry V. L

Re: Linux powerpc new system call instruction and ABI

2021-05-21 Thread Dmitry V. Levin
On Fri, May 21, 2021 at 05:00:36PM -0300, Matheus Castanho wrote: > Florian Weimer writes: > > * Matheus Castanho via Libc-alpha: > >> From: Nicholas Piggin > >> Subject: [PATCH 1/1] powerpc: Fix handling of scv return error codes > >> > >> When using scv on templated ASM syscalls, current code

Re: Linux powerpc new system call instruction and ABI

2021-05-19 Thread Dmitry V. Levin
On Thu, May 20, 2021 at 08:51:53AM +1000, Nicholas Piggin wrote: > Excerpts from Dmitry V. Levin's message of May 19, 2021 11:26 pm: > > On Wed, May 19, 2021 at 08:59:05PM +1000, Nicholas Piggin wrote: > >> Excerpts from Dmitry V. Levin's message of May 19, 2021 8:24 pm: > >> > On Wed, May 19,

Re: Linux powerpc new system call instruction and ABI

2021-05-19 Thread Dmitry V. Levin
On Wed, May 19, 2021 at 07:48:47PM -0400, Rich Felker wrote: > On Wed, May 19, 2021 at 06:09:25PM +, Joakim Tjernlund wrote: [...] > > W.r.t breaking ABI, isn't that what PowerPC is trying to do with the new > > syscall I/F? > > No, it's a new independent interface. Unfortunately, being a

Re: [PATCH] powerpc/audit: Simplify syscall_get_arch()

2022-01-13 Thread Dmitry V. Levin
On Fri, Aug 20, 2021 at 09:39:14AM +, Christophe Leroy wrote: > Make use of is_32bit_task() and CONFIG_CPU_LITTLE_ENDIAN > to simplify syscall_get_arch(). > > Signed-off-by: Christophe Leroy > --- > arch/powerpc/include/asm/syscall.h | 15 +-- > 1 file changed, 5 insertions(+),