Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-06-14 Thread Yury Norov
Hi Catalin, David, all > COMPAT_SYSCALL_WRAP2(creat, ...): > mov w0, w0 > b > > > > Cost wise, this seems like it all cancels out in the end, but what > > > do I know? > > > > I think you know something, and I also think Heiko and other s390 guys > > know something as

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-06-14 Thread Yury Norov
Hi Catalin, David, all > COMPAT_SYSCALL_WRAP2(creat, ...): > mov w0, w0 > b > > > > Cost wise, this seems like it all cancels out in the end, but what > > > do I know? > > > > I think you know something, and I also think Heiko and other s390 guys > > know something as

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-27 Thread Catalin Marinas
On Fri, May 27, 2016 at 07:58:06PM +0300, Yury Norov wrote: > So, we have 3 options for now: > 1. Clear top halves in entry.S which means we pass off_t as a pair. >The cost is performance (didn't measure it yet and doubt about it >makes serious impact). The advantage is simplicity and

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-27 Thread Catalin Marinas
On Fri, May 27, 2016 at 07:58:06PM +0300, Yury Norov wrote: > So, we have 3 options for now: > 1. Clear top halves in entry.S which means we pass off_t as a pair. >The cost is performance (didn't measure it yet and doubt about it >makes serious impact). The advantage is simplicity and

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-27 Thread Yury Norov
On Fri, May 27, 2016 at 02:04:47PM +0100, Catalin Marinas wrote: > On Fri, May 27, 2016 at 12:49:11PM +0200, Arnd Bergmann wrote: > > On Friday, May 27, 2016 10:30:52 AM CEST Catalin Marinas wrote: > > > On Fri, May 27, 2016 at 10:42:59AM +0200, Arnd Bergmann wrote: > > > > On Friday, May 27, 2016

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-27 Thread Yury Norov
On Fri, May 27, 2016 at 02:04:47PM +0100, Catalin Marinas wrote: > On Fri, May 27, 2016 at 12:49:11PM +0200, Arnd Bergmann wrote: > > On Friday, May 27, 2016 10:30:52 AM CEST Catalin Marinas wrote: > > > On Fri, May 27, 2016 at 10:42:59AM +0200, Arnd Bergmann wrote: > > > > On Friday, May 27, 2016

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-27 Thread Catalin Marinas
On Fri, May 27, 2016 at 12:49:11PM +0200, Arnd Bergmann wrote: > On Friday, May 27, 2016 10:30:52 AM CEST Catalin Marinas wrote: > > On Fri, May 27, 2016 at 10:42:59AM +0200, Arnd Bergmann wrote: > > > On Friday, May 27, 2016 8:03:57 AM CEST Heiko Carstens wrote: > > > > > > > > Cost wise, this

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-27 Thread Catalin Marinas
On Fri, May 27, 2016 at 12:49:11PM +0200, Arnd Bergmann wrote: > On Friday, May 27, 2016 10:30:52 AM CEST Catalin Marinas wrote: > > On Fri, May 27, 2016 at 10:42:59AM +0200, Arnd Bergmann wrote: > > > On Friday, May 27, 2016 8:03:57 AM CEST Heiko Carstens wrote: > > > > > > > > Cost wise, this

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-27 Thread Arnd Bergmann
On Friday, May 27, 2016 10:30:52 AM CEST Catalin Marinas wrote: > On Fri, May 27, 2016 at 10:42:59AM +0200, Arnd Bergmann wrote: > > On Friday, May 27, 2016 8:03:57 AM CEST Heiko Carstens wrote: > > > > > > > Cost wise, this seems like it all cancels out in the end, but what > > > > > > > do I

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-27 Thread Arnd Bergmann
On Friday, May 27, 2016 10:30:52 AM CEST Catalin Marinas wrote: > On Fri, May 27, 2016 at 10:42:59AM +0200, Arnd Bergmann wrote: > > On Friday, May 27, 2016 8:03:57 AM CEST Heiko Carstens wrote: > > > > > > > Cost wise, this seems like it all cancels out in the end, but what > > > > > > > do I

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-27 Thread Catalin Marinas
On Thu, May 26, 2016 at 12:43:44PM -0700, David Miller wrote: > From: Catalin Marinas > Date: Thu, 26 May 2016 15:20:58 +0100 > > > We can solve (a) by adding more __SC_WRAP annotations in the generic > > unistd.h. > ... > > I really think it's much more robust to

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-27 Thread Catalin Marinas
On Thu, May 26, 2016 at 12:43:44PM -0700, David Miller wrote: > From: Catalin Marinas > Date: Thu, 26 May 2016 15:20:58 +0100 > > > We can solve (a) by adding more __SC_WRAP annotations in the generic > > unistd.h. > ... > > I really think it's much more robust to clear the tops of the

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-27 Thread Catalin Marinas
On Fri, May 27, 2016 at 10:42:59AM +0200, Arnd Bergmann wrote: > On Friday, May 27, 2016 8:03:57 AM CEST Heiko Carstens wrote: > > > > > > Cost wise, this seems like it all cancels out in the end, but what > > > > > > do I know? > > > > > > > > > > I think you know something, and I also think

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-27 Thread Catalin Marinas
On Fri, May 27, 2016 at 10:42:59AM +0200, Arnd Bergmann wrote: > On Friday, May 27, 2016 8:03:57 AM CEST Heiko Carstens wrote: > > > > > > Cost wise, this seems like it all cancels out in the end, but what > > > > > > do I know? > > > > > > > > > > I think you know something, and I also think

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-27 Thread Catalin Marinas
On Fri, May 27, 2016 at 08:03:57AM +0200, Heiko Carstens wrote: > > > > The cost is pretty trivial though. See kernel/compat_wrapper.o: > > > > COMPAT_SYSCALL_WRAP2(creat, const char __user *, pathname, umode_t, > > > > mode); > > > > 0: a9bf7bfdstp x29, x30, [sp,#-16]! > > > > 4:

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-27 Thread Catalin Marinas
On Fri, May 27, 2016 at 08:03:57AM +0200, Heiko Carstens wrote: > > > > The cost is pretty trivial though. See kernel/compat_wrapper.o: > > > > COMPAT_SYSCALL_WRAP2(creat, const char __user *, pathname, umode_t, > > > > mode); > > > > 0: a9bf7bfdstp x29, x30, [sp,#-16]! > > > > 4:

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-27 Thread Arnd Bergmann
On Friday, May 27, 2016 8:03:57 AM CEST Heiko Carstens wrote: > > > > > Cost wise, this seems like it all cancels out in the end, but what > > > > > do I know? > > > > > > > > I think you know something, and I also think Heiko and other s390 guys > > > > know something as well. So I'd like to

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-27 Thread Arnd Bergmann
On Friday, May 27, 2016 8:03:57 AM CEST Heiko Carstens wrote: > > > > > Cost wise, this seems like it all cancels out in the end, but what > > > > > do I know? > > > > > > > > I think you know something, and I also think Heiko and other s390 guys > > > > know something as well. So I'd like to

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-27 Thread Heiko Carstens
> > > The cost is pretty trivial though. See kernel/compat_wrapper.o: > > > COMPAT_SYSCALL_WRAP2(creat, const char __user *, pathname, umode_t, mode); > > > 0: a9bf7bfdstp x29, x30, [sp,#-16]! > > > 4: 910003fdmov x29, sp > > > 8: 2a0003e0mov w0, w0 > > >

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-27 Thread Heiko Carstens
> > > The cost is pretty trivial though. See kernel/compat_wrapper.o: > > > COMPAT_SYSCALL_WRAP2(creat, const char __user *, pathname, umode_t, mode); > > > 0: a9bf7bfdstp x29, x30, [sp,#-16]! > > > 4: 910003fdmov x29, sp > > > 8: 2a0003e0mov w0, w0 > > >

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-26 Thread Heiko Carstens
On Wed, May 25, 2016 at 12:30:17PM -0700, David Miller wrote: > From: Yury Norov > Date: Tue, 24 May 2016 03:04:30 +0300 > > > +To clear that top halves, automatic wrappers are introduced. They clear all > > +required registers before passing control to regular syscall

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-26 Thread Heiko Carstens
On Wed, May 25, 2016 at 12:30:17PM -0700, David Miller wrote: > From: Yury Norov > Date: Tue, 24 May 2016 03:04:30 +0300 > > > +To clear that top halves, automatic wrappers are introduced. They clear all > > +required registers before passing control to regular syscall handler. > > Why have one

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-26 Thread Yury Norov
On Thu, May 26, 2016 at 11:29:45PM +0100, Catalin Marinas wrote: > On Thu, May 26, 2016 at 11:48:19PM +0300, Yury Norov wrote: > > On Wed, May 25, 2016 at 02:28:21PM -0700, David Miller wrote: > > > From: Arnd Bergmann > > > Date: Wed, 25 May 2016 23:01:06 +0200 > > > > > > > On

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-26 Thread Yury Norov
On Thu, May 26, 2016 at 11:29:45PM +0100, Catalin Marinas wrote: > On Thu, May 26, 2016 at 11:48:19PM +0300, Yury Norov wrote: > > On Wed, May 25, 2016 at 02:28:21PM -0700, David Miller wrote: > > > From: Arnd Bergmann > > > Date: Wed, 25 May 2016 23:01:06 +0200 > > > > > > > On Wednesday, May

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-26 Thread Catalin Marinas
On Thu, May 26, 2016 at 11:48:19PM +0300, Yury Norov wrote: > On Wed, May 25, 2016 at 02:28:21PM -0700, David Miller wrote: > > From: Arnd Bergmann > > Date: Wed, 25 May 2016 23:01:06 +0200 > > > > > On Wednesday, May 25, 2016 1:50:39 PM CEST David Miller wrote: > > >> From: Arnd

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-26 Thread Catalin Marinas
On Thu, May 26, 2016 at 11:48:19PM +0300, Yury Norov wrote: > On Wed, May 25, 2016 at 02:28:21PM -0700, David Miller wrote: > > From: Arnd Bergmann > > Date: Wed, 25 May 2016 23:01:06 +0200 > > > > > On Wednesday, May 25, 2016 1:50:39 PM CEST David Miller wrote: > > >> From: Arnd Bergmann > >

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-26 Thread Yury Norov
On Wed, May 25, 2016 at 02:28:21PM -0700, David Miller wrote: > From: Arnd Bergmann > Date: Wed, 25 May 2016 23:01:06 +0200 > > > On Wednesday, May 25, 2016 1:50:39 PM CEST David Miller wrote: > >> From: Arnd Bergmann > >> Date: Wed, 25 May 2016 22:47:33 +0200 > >>

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-26 Thread Yury Norov
On Wed, May 25, 2016 at 02:28:21PM -0700, David Miller wrote: > From: Arnd Bergmann > Date: Wed, 25 May 2016 23:01:06 +0200 > > > On Wednesday, May 25, 2016 1:50:39 PM CEST David Miller wrote: > >> From: Arnd Bergmann > >> Date: Wed, 25 May 2016 22:47:33 +0200 > >> > >> > If we use the normal

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-26 Thread David Miller
From: Catalin Marinas Date: Thu, 26 May 2016 15:20:58 +0100 > We can solve (a) by adding more __SC_WRAP annotations in the generic > unistd.h. ... I really think it's much more robust to clear the tops of the registers by default. Then you won't be auditing constantly

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-26 Thread David Miller
From: Catalin Marinas Date: Thu, 26 May 2016 15:20:58 +0100 > We can solve (a) by adding more __SC_WRAP annotations in the generic > unistd.h. ... I really think it's much more robust to clear the tops of the registers by default. Then you won't be auditing constantly and adding more and more

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-26 Thread Catalin Marinas
On Thu, May 26, 2016 at 03:50:01PM +0100, Szabolcs Nagy wrote: > On 26/05/16 15:20, Catalin Marinas wrote: > > While writing the above, I realised the current ILP32 patches still miss > > on converting pointers passed from user space (unless I got myself > > confused in macros). The new

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-26 Thread Catalin Marinas
On Thu, May 26, 2016 at 03:50:01PM +0100, Szabolcs Nagy wrote: > On 26/05/16 15:20, Catalin Marinas wrote: > > While writing the above, I realised the current ILP32 patches still miss > > on converting pointers passed from user space (unless I got myself > > confused in macros). The new

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-26 Thread Szabolcs Nagy
On 26/05/16 15:20, Catalin Marinas wrote: > While writing the above, I realised the current ILP32 patches still miss > on converting pointers passed from user space (unless I got myself > confused in macros). The new __SC_WRAP() and COMPAT_SYSCALL_WRAPx() > macros take care of zero or sign

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-26 Thread Szabolcs Nagy
On 26/05/16 15:20, Catalin Marinas wrote: > While writing the above, I realised the current ILP32 patches still miss > on converting pointers passed from user space (unless I got myself > confused in macros). The new __SC_WRAP() and COMPAT_SYSCALL_WRAPx() > macros take care of zero or sign

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-26 Thread Catalin Marinas
On Wed, May 25, 2016 at 02:28:21PM -0700, David Miller wrote: > From: Arnd Bergmann > Date: Wed, 25 May 2016 23:01:06 +0200 > > > On Wednesday, May 25, 2016 1:50:39 PM CEST David Miller wrote: > >> From: Arnd Bergmann > >> Date: Wed, 25 May 2016 22:47:33 +0200 > >>

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-26 Thread Catalin Marinas
On Wed, May 25, 2016 at 02:28:21PM -0700, David Miller wrote: > From: Arnd Bergmann > Date: Wed, 25 May 2016 23:01:06 +0200 > > > On Wednesday, May 25, 2016 1:50:39 PM CEST David Miller wrote: > >> From: Arnd Bergmann > >> Date: Wed, 25 May 2016 22:47:33 +0200 > >> > >> > If we use the normal

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-25 Thread David Miller
From: Arnd Bergmann Date: Wed, 25 May 2016 23:01:06 +0200 > On Wednesday, May 25, 2016 1:50:39 PM CEST David Miller wrote: >> From: Arnd Bergmann >> Date: Wed, 25 May 2016 22:47:33 +0200 >> >> > If we use the normal calling conventions, we could remove these

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-25 Thread David Miller
From: Arnd Bergmann Date: Wed, 25 May 2016 23:01:06 +0200 > On Wednesday, May 25, 2016 1:50:39 PM CEST David Miller wrote: >> From: Arnd Bergmann >> Date: Wed, 25 May 2016 22:47:33 +0200 >> >> > If we use the normal calling conventions, we could remove these overrides >> > along with the

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-25 Thread Arnd Bergmann
On Wednesday, May 25, 2016 1:50:39 PM CEST David Miller wrote: > From: Arnd Bergmann > Date: Wed, 25 May 2016 22:47:33 +0200 > > > If we use the normal calling conventions, we could remove these overrides > > along with the respective special-case handling in glibc. None of them >

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-25 Thread Arnd Bergmann
On Wednesday, May 25, 2016 1:50:39 PM CEST David Miller wrote: > From: Arnd Bergmann > Date: Wed, 25 May 2016 22:47:33 +0200 > > > If we use the normal calling conventions, we could remove these overrides > > along with the respective special-case handling in glibc. None of them > > look

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-25 Thread David Miller
From: Arnd Bergmann Date: Wed, 25 May 2016 22:47:33 +0200 > If we use the normal calling conventions, we could remove these overrides > along with the respective special-case handling in glibc. None of them > look particularly performance-sensitive, but I could be wrong there.

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-25 Thread David Miller
From: Arnd Bergmann Date: Wed, 25 May 2016 22:47:33 +0200 > If we use the normal calling conventions, we could remove these overrides > along with the respective special-case handling in glibc. None of them > look particularly performance-sensitive, but I could be wrong there. You could set the

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-25 Thread Arnd Bergmann
On Wednesday, May 25, 2016 1:21:45 PM CEST David Miller wrote: > From: Yury Norov > Date: Wed, 25 May 2016 23:03:27 +0300 > > > On Wed, May 25, 2016 at 12:30:17PM -0700, David Miller wrote: > >> From: Yury Norov > >> Date: Tue, 24 May 2016

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-25 Thread Arnd Bergmann
On Wednesday, May 25, 2016 1:21:45 PM CEST David Miller wrote: > From: Yury Norov > Date: Wed, 25 May 2016 23:03:27 +0300 > > > On Wed, May 25, 2016 at 12:30:17PM -0700, David Miller wrote: > >> From: Yury Norov > >> Date: Tue, 24 May 2016 03:04:30 +0300 > >> > >> > +To clear that top halves,

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-25 Thread David Miller
From: Yury Norov Date: Wed, 25 May 2016 23:03:27 +0300 > On Wed, May 25, 2016 at 12:30:17PM -0700, David Miller wrote: >> From: Yury Norov >> Date: Tue, 24 May 2016 03:04:30 +0300 >> >> > +To clear that top halves, automatic wrappers are

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-25 Thread David Miller
From: Yury Norov Date: Wed, 25 May 2016 23:03:27 +0300 > On Wed, May 25, 2016 at 12:30:17PM -0700, David Miller wrote: >> From: Yury Norov >> Date: Tue, 24 May 2016 03:04:30 +0300 >> >> > +To clear that top halves, automatic wrappers are introduced. They clear >> > all >> > +required

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-25 Thread Yury Norov
On Wed, May 25, 2016 at 12:30:17PM -0700, David Miller wrote: > From: Yury Norov > Date: Tue, 24 May 2016 03:04:30 +0300 > > > +To clear that top halves, automatic wrappers are introduced. They clear all > > +required registers before passing control to regular syscall

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-25 Thread Yury Norov
On Wed, May 25, 2016 at 12:30:17PM -0700, David Miller wrote: > From: Yury Norov > Date: Tue, 24 May 2016 03:04:30 +0300 > > > +To clear that top halves, automatic wrappers are introduced. They clear all > > +required registers before passing control to regular syscall handler. > > Why have one

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-25 Thread David Miller
From: Yury Norov Date: Tue, 24 May 2016 03:04:30 +0300 > +To clear that top halves, automatic wrappers are introduced. They clear all > +required registers before passing control to regular syscall handler. Why have one of these for every single compat system call,

Re: [PATCH 01/23] all: syscall wrappers: add documentation

2016-05-25 Thread David Miller
From: Yury Norov Date: Tue, 24 May 2016 03:04:30 +0300 > +To clear that top halves, automatic wrappers are introduced. They clear all > +required registers before passing control to regular syscall handler. Why have one of these for every single compat system call, rather than simply clearing

[PATCH 01/23] all: syscall wrappers: add documentation

2016-05-23 Thread Yury Norov
Signed-off-by: Yury Norov --- Documentation/adding-syscalls.txt | 32 1 file changed, 32 insertions(+) diff --git a/Documentation/adding-syscalls.txt b/Documentation/adding-syscalls.txt index cc2d4ac..d02a6bd 100644 ---

[PATCH 01/23] all: syscall wrappers: add documentation

2016-05-23 Thread Yury Norov
Signed-off-by: Yury Norov --- Documentation/adding-syscalls.txt | 32 1 file changed, 32 insertions(+) diff --git a/Documentation/adding-syscalls.txt b/Documentation/adding-syscalls.txt index cc2d4ac..d02a6bd 100644 --- a/Documentation/adding-syscalls.txt +++