[RFC PATCH 30/35] syscalls: do not call sys_link{,at}() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Al Viro CC: Andrew Morton Signed-off-by: Dominik Brodowski --- fs/internal.h| 2 ++ fs/namei.c | 12 +--- include/linux/syscalls.h | 8 init/initramfs.c | 2

[RFC PATCH 30/35] syscalls: do not call sys_link{,at}() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Al Viro CC: Andrew Morton Signed-off-by: Dominik Brodowski --- fs/internal.h| 2 ++ fs/namei.c | 12 +--- include/linux/syscalls.h | 8 init/initramfs.c | 2 +- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git

[RFC PATCH 31/35] syscalls: do not call sys_{f,}chmod{at,}() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Al Viro CC: Andrew Morton Signed-off-by: Dominik Brodowski --- fs/internal.h| 2 ++ fs/open.c| 17 ++--- include/linux/syscalls.h | 7 +++ init/initramfs.c

[RFC PATCH 31/35] syscalls: do not call sys_{f,}chmod{at,}() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Al Viro CC: Andrew Morton Signed-off-by: Dominik Brodowski --- fs/internal.h| 2 ++ fs/open.c| 17 ++--- include/linux/syscalls.h | 7 +++ init/initramfs.c | 6 +++--- 4 files changed, 26 insertions(+), 6 deletions(-) diff --git

[RFC PATCH 00/35] remove in-kernel syscall invocations

2018-03-11 Thread Dominik Brodowski
Here is a first set of patches which reduce the number of syscall invocations from within the kernel. The rationale for this change is described in patch 1 as follows: The syscall entry points to the kernel defined by SYSCALL_DEFINEx() and COMPAT_SYSCALL_DEFINEx() should only be

[RFC PATCH 12/35] syscalls: do not call sys_rt_sigpending() within the kernel

2018-03-11 Thread Dominik Brodowski
A similar code path is already open-coded three times (in sys_rt_sigpending and in the two compat stubs), so do it a fourth time here. CC: Al Viro CC: Andrew Morton Signed-off-by: Dominik Brodowski ---

[RFC PATCH 00/35] remove in-kernel syscall invocations

2018-03-11 Thread Dominik Brodowski
Here is a first set of patches which reduce the number of syscall invocations from within the kernel. The rationale for this change is described in patch 1 as follows: The syscall entry points to the kernel defined by SYSCALL_DEFINEx() and COMPAT_SYSCALL_DEFINEx() should only be

[RFC PATCH 12/35] syscalls: do not call sys_rt_sigpending() within the kernel

2018-03-11 Thread Dominik Brodowski
A similar code path is already open-coded three times (in sys_rt_sigpending and in the two compat stubs), so do it a fourth time here. CC: Al Viro CC: Andrew Morton Signed-off-by: Dominik Brodowski --- include/linux/syscalls.h | 2 +- kernel/signal.c | 13 +++-- 2 files

[RFC PATCH 04/35] syscalls: do not call sys_getpgid() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Al Viro Signed-off-by: Dominik Brodowski --- kernel/sys.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/kernel/sys.c b/kernel/sys.c index f2289de20e19..ebb138b841c8 100644 --- a/kernel/sys.c +++

[RFC PATCH 04/35] syscalls: do not call sys_getpgid() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Al Viro Signed-off-by: Dominik Brodowski --- kernel/sys.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/kernel/sys.c b/kernel/sys.c index f2289de20e19..ebb138b841c8 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -1027,7 +1027,7 @@ SYSCALL_DEFINE2(setpgid,

[RFC PATCH 10/35] syscalls: do not call sys_signalfd4() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Alexander Viro Signed-off-by: Dominik Brodowski --- fs/signalfd.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/fs/signalfd.c b/fs/signalfd.c index 76bf9cc62074..501c41f3351f 100644 ---

[RFC PATCH 10/35] syscalls: do not call sys_signalfd4() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Alexander Viro Signed-off-by: Dominik Brodowski --- fs/signalfd.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/fs/signalfd.c b/fs/signalfd.c index 76bf9cc62074..501c41f3351f 100644 --- a/fs/signalfd.c +++ b/fs/signalfd.c @@ -256,8 +256,8 @@ static

[RFC PATCH 34/35] syscalls: do not call sys_{,l,f}chown() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Al Viro CC: Andrew Morton Signed-off-by: Dominik Brodowski --- arch/s390/kernel/compat_linux.c | 6 +++--- fs/internal.h | 2 ++ fs/open.c | 23 +--

[RFC PATCH 34/35] syscalls: do not call sys_{,l,f}chown() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Al Viro CC: Andrew Morton Signed-off-by: Dominik Brodowski --- arch/s390/kernel/compat_linux.c | 6 +++--- fs/internal.h | 2 ++ fs/open.c | 23 +-- include/linux/syscalls.h| 14 ++ init/initramfs.c

[RFC PATCH 14/35] syscalls: do not call sys_mount() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Alexander Viro Signed-off-by: Dominik Brodowski --- drivers/base/devtmpfs.c | 5 +++-- fs/namespace.c | 10 -- include/linux/syscalls.h | 3 +++ init/do_mounts.c | 4 ++-- init/do_mounts_initrd.c | 6 +++---

[RFC PATCH 14/35] syscalls: do not call sys_mount() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Alexander Viro Signed-off-by: Dominik Brodowski --- drivers/base/devtmpfs.c | 5 +++-- fs/namespace.c | 10 -- include/linux/syscalls.h | 3 +++ init/do_mounts.c | 4 ++-- init/do_mounts_initrd.c | 6 +++--- 5 files changed, 19 insertions(+), 9 deletions(-)

[RFC PATCH 32/35] syscalls: do not call sys_{f,}access{,at}() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Al Viro CC: Andrew Morton Signed-off-by: Dominik Brodowski --- fs/internal.h| 1 + fs/open.c| 9 +++-- include/linux/syscalls.h | 6 ++ init/main.c | 3 ++- 4

[RFC PATCH 32/35] syscalls: do not call sys_{f,}access{,at}() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Al Viro CC: Andrew Morton Signed-off-by: Dominik Brodowski --- fs/internal.h| 1 + fs/open.c| 9 +++-- include/linux/syscalls.h | 6 ++ init/main.c | 3 ++- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/fs/internal.h

[RFC PATCH 17/35] syscalls: do not call sys_chroot() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Alexander Viro Signed-off-by: Dominik Brodowski --- drivers/base/devtmpfs.c | 2 +- fs/open.c| 7 ++- include/linux/syscalls.h | 1 + init/do_mounts.c | 2 +- init/do_mounts_initrd.c | 4 ++-- 5 files

[RFC PATCH 17/35] syscalls: do not call sys_chroot() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Alexander Viro Signed-off-by: Dominik Brodowski --- drivers/base/devtmpfs.c | 2 +- fs/open.c| 7 ++- include/linux/syscalls.h | 1 + init/do_mounts.c | 2 +- init/do_mounts_initrd.c | 4 ++-- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git

[RFC PATCH 02/35] syscalls: use kernel_wait4() instead of sys_wait4()

2018-03-11 Thread Dominik Brodowski
All call sites of sys_wait4() set *rusage to NULL. Therefore, there is no need for the copy_to_user() handling of *rusage, and we can use kernel_wait4() directly. CC: Luis R. Rodriguez CC: Al Viro CC: Andrew Morton

[RFC PATCH 02/35] syscalls: use kernel_wait4() instead of sys_wait4()

2018-03-11 Thread Dominik Brodowski
All call sites of sys_wait4() set *rusage to NULL. Therefore, there is no need for the copy_to_user() handling of *rusage, and we can use kernel_wait4() directly. CC: Luis R. Rodriguez CC: Al Viro CC: Andrew Morton Signed-off-by: Dominik Brodowski --- kernel/exit.c | 2 +-

[RFC PATCH 13/35] syscalls: do not call sys_ioperm() within the kernel

2018-03-11 Thread Dominik Brodowski
While at it, use SYSCALL_DEFINE3() instead of a hand-crafted syscall definition. CC: Thomas Gleixner CC: Ingo Molnar CC: Greg Kroah-Hartman CC: Jiri Slaby CC: x...@kernel.org Signed-off-by: Dominik Brodowski

[RFC PATCH 01/35] syscalls: define goal to not call sys_xyzzy() from within the kernel

2018-03-11 Thread Dominik Brodowski
The syscall entry points to the kernel defined by SYSCALL_DEFINEx() and COMPAT_SYSCALL_DEFINEx() should only be called from userspace through kernel entry points, but not from the kernel itself. This will allow cleanups and optimizations to the entry paths *and* to the parts of the kernel code

[RFC PATCH 13/35] syscalls: do not call sys_ioperm() within the kernel

2018-03-11 Thread Dominik Brodowski
While at it, use SYSCALL_DEFINE3() instead of a hand-crafted syscall definition. CC: Thomas Gleixner CC: Ingo Molnar CC: Greg Kroah-Hartman CC: Jiri Slaby CC: x...@kernel.org Signed-off-by: Dominik Brodowski --- arch/x86/include/asm/syscalls.h | 1 + arch/x86/kernel/ioport.c| 7

[RFC PATCH 01/35] syscalls: define goal to not call sys_xyzzy() from within the kernel

2018-03-11 Thread Dominik Brodowski
The syscall entry points to the kernel defined by SYSCALL_DEFINEx() and COMPAT_SYSCALL_DEFINEx() should only be called from userspace through kernel entry points, but not from the kernel itself. This will allow cleanups and optimizations to the entry paths *and* to the parts of the kernel code

[RFC PATCH 29/35] syscalls: do not call sys_mknod{,at}() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Al Viro CC: Andrew Morton Signed-off-by: Dominik Brodowski --- fs/internal.h| 2 ++ fs/namei.c | 12 +--- include/linux/syscalls.h | 8 init/do_mounts.h | 2

[RFC PATCH 29/35] syscalls: do not call sys_mknod{,at}() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Al Viro CC: Andrew Morton Signed-off-by: Dominik Brodowski --- fs/internal.h| 2 ++ fs/namei.c | 12 +--- include/linux/syscalls.h | 8 init/do_mounts.h | 2 +- init/initramfs.c | 2 +- init/noinitramfs.c | 2 +- 6 files

[RFC PATCH 28/35] syscalls: do not call sys_symlink{,at}() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Al Viro CC: Andrew Morton Signed-off-by: Dominik Brodowski --- fs/internal.h| 2 ++ fs/namei.c | 12 +--- include/linux/syscalls.h | 8 init/initramfs.c | 2

[RFC PATCH 28/35] syscalls: do not call sys_symlink{,at}() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Al Viro CC: Andrew Morton Signed-off-by: Dominik Brodowski --- fs/internal.h| 2 ++ fs/namei.c | 12 +--- include/linux/syscalls.h | 8 init/initramfs.c | 2 +- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git

[RFC PATCH 20/35] syscalls: do not call sys_fadvise64{,_64}() within the kernel

2018-03-11 Thread Dominik Brodowski
Some compat stubs called sys_fadvise64(), which then just passed through the arguments to sys_fadvise64_64(). Get rid of this indirection. CC: Andrew Morton CC: linux...@kvack.org Signed-off-by: Dominik Brodowski ---

[RFC PATCH 20/35] syscalls: do not call sys_fadvise64{,_64}() within the kernel

2018-03-11 Thread Dominik Brodowski
Some compat stubs called sys_fadvise64(), which then just passed through the arguments to sys_fadvise64_64(). Get rid of this indirection. CC: Andrew Morton CC: linux...@kvack.org Signed-off-by: Dominik Brodowski --- arch/arm/kernel/sys_arm.c | 2 +- arch/metag/kernel/sys_metag.c | 2

[RFC PATCH 15/35] syscalls: do not call sys_umount() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Alexander Viro Signed-off-by: Dominik Brodowski --- fs/namespace.c | 9 +++-- include/linux/syscalls.h | 1 + init/do_mounts_initrd.c | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/fs/namespace.c

[RFC PATCH 15/35] syscalls: do not call sys_umount() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Alexander Viro Signed-off-by: Dominik Brodowski --- fs/namespace.c | 9 +++-- include/linux/syscalls.h | 1 + init/do_mounts_initrd.c | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/fs/namespace.c b/fs/namespace.c index 642b8b229944..e398f32d7541 100644

[RFC PATCH 21/35] syscalls: do not call sys_mmap_pgoff() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Andrew Morton CC: linux...@kvack.org Signed-off-by: Dominik Brodowski --- arch/alpha/kernel/osf_sys.c | 2 +- arch/arm64/kernel/sys.c | 2 +- arch/cris/kernel/sys_cris.c | 2 +-

[RFC PATCH 05/35] syscalls: do not call sys_readlinkat() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Alexander Viro Signed-off-by: Dominik Brodowski --- fs/stat.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/fs/stat.c b/fs/stat.c index 873785dae022..f8e6fb2c3657 100644 --- a/fs/stat.c +++ b/fs/stat.c

[RFC PATCH 21/35] syscalls: do not call sys_mmap_pgoff() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Andrew Morton CC: linux...@kvack.org Signed-off-by: Dominik Brodowski --- arch/alpha/kernel/osf_sys.c | 2 +- arch/arm64/kernel/sys.c | 2 +- arch/cris/kernel/sys_cris.c | 2 +- arch/frv/kernel/sys_frv.c | 4 ++--

[RFC PATCH 05/35] syscalls: do not call sys_readlinkat() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Alexander Viro Signed-off-by: Dominik Brodowski --- fs/stat.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/fs/stat.c b/fs/stat.c index 873785dae022..f8e6fb2c3657 100644 --- a/fs/stat.c +++ b/fs/stat.c @@ -379,8 +379,8 @@ SYSCALL_DEFINE2(newfstat, unsigned

[RFC PATCH 27/35] syscalls: do not call sys_mkdir{,at}() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Al Viro CC: Andrew Morton Signed-off-by: Dominik Brodowski --- fs/internal.h| 1 + fs/namei.c | 9 +++-- include/linux/syscalls.h | 6 ++ init/do_mounts_initrd.c | 2 +-

[RFC PATCH 27/35] syscalls: do not call sys_mkdir{,at}() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Al Viro CC: Andrew Morton Signed-off-by: Dominik Brodowski --- fs/internal.h| 1 + fs/namei.c | 9 +++-- include/linux/syscalls.h | 6 ++ init/do_mounts_initrd.c | 2 +- init/initramfs.c | 2 +- init/noinitramfs.c | 4 ++-- 6 files changed,

[RFC PATCH 18/35] syscalls: do not call sys_write() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Alexander Viro CC: linux-s...@vger.kernel.org Signed-off-by: Dominik Brodowski --- arch/s390/kernel/compat_linux.c | 2 +- fs/read_write.c | 9 +++-- include/linux/syscalls.h| 1 + init/do_mounts_rd.c

[RFC PATCH 18/35] syscalls: do not call sys_write() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Alexander Viro CC: linux-s...@vger.kernel.org Signed-off-by: Dominik Brodowski --- arch/s390/kernel/compat_linux.c | 2 +- fs/read_write.c | 9 +++-- include/linux/syscalls.h| 1 + init/do_mounts_rd.c | 4 ++-- init/initramfs.c| 2 +-

[RFC PATCH 24/35] syscalls: do not call sys_unlink() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Al Viro CC: Andrew Morton Signed-off-by: Dominik Brodowski --- include/linux/syscalls.h | 10 ++ init/do_mounts.h | 2 +- init/do_mounts_initrd.c | 4 ++-- init/do_mounts_rd.c | 2 +-

[RFC PATCH 24/35] syscalls: do not call sys_unlink() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Al Viro CC: Andrew Morton Signed-off-by: Dominik Brodowski --- include/linux/syscalls.h | 10 ++ init/do_mounts.h | 2 +- init/do_mounts_initrd.c | 4 ++-- init/do_mounts_rd.c | 2 +- init/initramfs.c | 4 ++-- 5 files changed, 16 insertions(+), 6

[RFC PATCH 23/35] syscalls: do not call sys_sync_file_range() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Al Viro CC: Andrew Morton Signed-off-by: Dominik Brodowski --- arch/metag/kernel/sys_metag.c | 4 ++-- arch/mips/kernel/linux32.c | 2 +- arch/parisc/kernel/sys_parisc.c | 2 +-

[RFC PATCH 23/35] syscalls: do not call sys_sync_file_range() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Al Viro CC: Andrew Morton Signed-off-by: Dominik Brodowski --- arch/metag/kernel/sys_metag.c | 4 ++-- arch/mips/kernel/linux32.c | 2 +- arch/parisc/kernel/sys_parisc.c | 2 +- arch/powerpc/kernel/sys_ppc32.c | 2 +- arch/s390/kernel/compat_linux.c | 2 +-

[RFC PATCH 35/35] syscalls: do not call sys_close() within the kernel

2018-03-11 Thread Dominik Brodowski
The few places which checked the return value did not care about the return value re-writing in sys_close(), so simply use a wrapper to __close_fd(). CC: Al Viro CC: Andrew Morton Signed-off-by: Dominik Brodowski

[RFC PATCH 25/35] hostfs: rename do_rmdir() to hostfs_do_rmdir()

2018-03-11 Thread Dominik Brodowski
do_rmdir() is used in the VFS layer at fs/namei.c, so use a different name in hostfs. CC: Jeff Dike CC: Richard Weinberger CC: user-mode-linux-de...@lists.sourceforge.net Signed-off-by: Dominik Brodowski --- fs/hostfs/hostfs.h

[RFC PATCH 33/35] syscalls: do not call sys_ftruncate() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Al Viro CC: Andrew Morton Signed-off-by: Dominik Brodowski --- arch/mips/kernel/linux32.c | 2 +- arch/parisc/kernel/sys_parisc.c | 4 ++-- arch/powerpc/kernel/sys_ppc32.c | 2 +-

[RFC PATCH 35/35] syscalls: do not call sys_close() within the kernel

2018-03-11 Thread Dominik Brodowski
The few places which checked the return value did not care about the return value re-writing in sys_close(), so simply use a wrapper to __close_fd(). CC: Al Viro CC: Andrew Morton Signed-off-by: Dominik Brodowski --- fs/autofs4/dev-ioctl.c | 2 +- fs/binfmt_misc.c | 2 +- fs/file.c

[RFC PATCH 25/35] hostfs: rename do_rmdir() to hostfs_do_rmdir()

2018-03-11 Thread Dominik Brodowski
do_rmdir() is used in the VFS layer at fs/namei.c, so use a different name in hostfs. CC: Jeff Dike CC: Richard Weinberger CC: user-mode-linux-de...@lists.sourceforge.net Signed-off-by: Dominik Brodowski --- fs/hostfs/hostfs.h | 2 +- fs/hostfs/hostfs_kern.c | 2 +-

[RFC PATCH 33/35] syscalls: do not call sys_ftruncate() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Al Viro CC: Andrew Morton Signed-off-by: Dominik Brodowski --- arch/mips/kernel/linux32.c | 2 +- arch/parisc/kernel/sys_parisc.c | 4 ++-- arch/powerpc/kernel/sys_ppc32.c | 2 +- arch/s390/kernel/compat_linux.c | 2 +- arch/sparc/kernel/sys_sparc32.c | 2 +- arch/tile/kernel/compat.c

[RFC PATCH 09/35] syscalls: do not call sys_epoll_*() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Alexander Viro Signed-off-by: Dominik Brodowski --- fs/eventpoll.c | 23 +-- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 0f3494ed3ed0..602ca4285b2e 100644 ---

[RFC PATCH 06/35] syscalls: do not call sys_pipe2() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Alexander Viro Signed-off-by: Dominik Brodowski --- fs/pipe.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fs/pipe.c b/fs/pipe.c index 7b1954caf388..39d6f431da83 100644 --- a/fs/pipe.c +++ b/fs/pipe.c @@

[RFC PATCH 06/35] syscalls: do not call sys_pipe2() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Alexander Viro Signed-off-by: Dominik Brodowski --- fs/pipe.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fs/pipe.c b/fs/pipe.c index 7b1954caf388..39d6f431da83 100644 --- a/fs/pipe.c +++ b/fs/pipe.c @@ -841,7 +841,7 @@ int do_pipe_flags(int *fd, int flags)

[RFC PATCH 09/35] syscalls: do not call sys_epoll_*() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Alexander Viro Signed-off-by: Dominik Brodowski --- fs/eventpoll.c | 23 +-- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 0f3494ed3ed0..602ca4285b2e 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c @@ -1936,7

[RFC PATCH 19/35] syscalls: do not call sys_unshare() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Al Viro CC: Andrew Morton CC: Ingo Molnar Signed-off-by: Dominik Brodowski --- drivers/base/devtmpfs.c | 2 +- include/linux/syscalls.h | 1 + init/do_mounts_initrd.c | 2 +- kernel/fork.c

[RFC PATCH 19/35] syscalls: do not call sys_unshare() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Al Viro CC: Andrew Morton CC: Ingo Molnar Signed-off-by: Dominik Brodowski --- drivers/base/devtmpfs.c | 2 +- include/linux/syscalls.h | 1 + init/do_mounts_initrd.c | 2 +- kernel/fork.c| 7 ++- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git

[RFC PATCH 08/35] syscalls: do not call sys_futimesat() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Alexander Viro Signed-off-by: Dominik Brodowski --- fs/utimes.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/fs/utimes.c b/fs/utimes.c index e4b3d7c2c9f5..5be035ed26c0 100644 --- a/fs/utimes.c +++

[RFC PATCH 26/35] syscalls: do not call sys_rmdir() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Al Viro CC: Andrew Morton Signed-off-by: Dominik Brodowski --- fs/internal.h| 1 + fs/namei.c | 2 +- include/linux/syscalls.h | 6 ++ init/initramfs.c | 4 ++-- 4 files

[RFC PATCH 08/35] syscalls: do not call sys_futimesat() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Alexander Viro Signed-off-by: Dominik Brodowski --- fs/utimes.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/fs/utimes.c b/fs/utimes.c index e4b3d7c2c9f5..5be035ed26c0 100644 --- a/fs/utimes.c +++ b/fs/utimes.c @@ -184,8 +184,8 @@

[RFC PATCH 26/35] syscalls: do not call sys_rmdir() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Al Viro CC: Andrew Morton Signed-off-by: Dominik Brodowski --- fs/internal.h| 1 + fs/namei.c | 2 +- include/linux/syscalls.h | 6 ++ init/initramfs.c | 4 ++-- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/fs/internal.h

[RFC PATCH 16/35] syscalls: do not call sys_dup{,3}() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Alexander Viro Signed-off-by: Dominik Brodowski --- fs/file.c| 16 +--- include/linux/syscalls.h | 1 + init/do_mounts_initrd.c | 4 ++-- init/main.c | 4 ++-- 4 files changed, 18

[RFC PATCH 16/35] syscalls: do not call sys_dup{,3}() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Alexander Viro Signed-off-by: Dominik Brodowski --- fs/file.c| 16 +--- include/linux/syscalls.h | 1 + init/do_mounts_initrd.c | 4 ++-- init/main.c | 4 ++-- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/fs/file.c b/fs/file.c

[RFC PATCH 07/35] syscalls: do not call sys_renameat2() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Alexander Viro Signed-off-by: Dominik Brodowski --- fs/namei.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/fs/namei.c b/fs/namei.c index 921ae32dbc80..524e829ffc7d 100644 --- a/fs/namei.c +++

[RFC PATCH 07/35] syscalls: do not call sys_renameat2() within the kernel

2018-03-11 Thread Dominik Brodowski
CC: Alexander Viro Signed-off-by: Dominik Brodowski --- fs/namei.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/fs/namei.c b/fs/namei.c index 921ae32dbc80..524e829ffc7d 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -4478,8 +4478,8 @@ int vfs_rename(struct

Re: 4.16-rc3 fails to resume on MacBookPro10,1 -

2018-03-11 Thread Pavel Machek
Hi! > >> This is 4.15 kernel with KPTI disabled: > >> % grep PAGE_TABLE .config > >> # CONFIG_PAGE_TABLE_ISOLATION is not set > >> > >> As I expected it appears no more infomative to me. > >> > >> What I really need is some clue as to what is supposed to be happening > >> at this point. > > > >

Re: 4.16-rc3 fails to resume on MacBookPro10,1 -

2018-03-11 Thread Pavel Machek
Hi! > >> This is 4.15 kernel with KPTI disabled: > >> % grep PAGE_TABLE .config > >> # CONFIG_PAGE_TABLE_ISOLATION is not set > >> > >> As I expected it appears no more infomative to me. > >> > >> What I really need is some clue as to what is supposed to be happening > >> at this point. > > > >

Re: [RFC/RFT][PATCH v3 0/6] sched/cpuidle: Idle loop rework

2018-03-11 Thread Rafael J. Wysocki
On Sunday, March 11, 2018 11:21:36 AM CET Rafael J. Wysocki wrote: > On Sunday, March 11, 2018 8:43:02 AM CET Doug Smythies wrote: > > On 2018.03.10 15:55 Rafael J. Wysocki wrote: > > >On Saturday, March 10, 2018 5:07:36 PM CET Doug Smythies wrote: > > >> On 2018.03.10 01:00 Rafael J. Wysocki

Re: [RFC/RFT][PATCH v3 0/6] sched/cpuidle: Idle loop rework

2018-03-11 Thread Rafael J. Wysocki
On Sunday, March 11, 2018 11:21:36 AM CET Rafael J. Wysocki wrote: > On Sunday, March 11, 2018 8:43:02 AM CET Doug Smythies wrote: > > On 2018.03.10 15:55 Rafael J. Wysocki wrote: > > >On Saturday, March 10, 2018 5:07:36 PM CET Doug Smythies wrote: > > >> On 2018.03.10 01:00 Rafael J. Wysocki

Re: [RFC/RFT][PATCH v3 5/6] sched: idle: Select idle state before stopping the tick

2018-03-11 Thread Rafael J. Wysocki
On Sunday, March 11, 2018 2:44:37 AM CET Frederic Weisbecker wrote: > On Fri, Mar 09, 2018 at 10:46:55AM +0100, Rafael J. Wysocki wrote: > > --- linux-pm.orig/kernel/time/tick-sched.h > > +++ linux-pm/kernel/time/tick-sched.h > > @@ -30,6 +30,7 @@ enum tick_nohz_mode { > > * when

Re: [RFC/RFT][PATCH v3 5/6] sched: idle: Select idle state before stopping the tick

2018-03-11 Thread Rafael J. Wysocki
On Sunday, March 11, 2018 2:44:37 AM CET Frederic Weisbecker wrote: > On Fri, Mar 09, 2018 at 10:46:55AM +0100, Rafael J. Wysocki wrote: > > --- linux-pm.orig/kernel/time/tick-sched.h > > +++ linux-pm/kernel/time/tick-sched.h > > @@ -30,6 +30,7 @@ enum tick_nohz_mode { > > * when

Re: 4.16-rc3 fails to resume on MacBookPro10,1 -

2018-03-11 Thread Rafael J. Wysocki
On Sunday, March 11, 2018 5:52:47 AM CET Andrew Worsley wrote: > > --94eb2c04c64405d3da05671bccce > Content-Type: text/plain; charset="UTF-8" > > On 11 March 2018 at 00:16, Pavel Machek wrote: > > Hi! > > > >> > Ok, I've just tested linux-next, and it works ok for me on thinkpad >

Re: 4.16-rc3 fails to resume on MacBookPro10,1 -

2018-03-11 Thread Rafael J. Wysocki
On Sunday, March 11, 2018 5:52:47 AM CET Andrew Worsley wrote: > > --94eb2c04c64405d3da05671bccce > Content-Type: text/plain; charset="UTF-8" > > On 11 March 2018 at 00:16, Pavel Machek wrote: > > Hi! > > > >> > Ok, I've just tested linux-next, and it works ok for me on thinkpad > >> > x60.

Re: [RFC/RFT][PATCH v3 0/6] sched/cpuidle: Idle loop rework

2018-03-11 Thread Rafael J. Wysocki
On Sunday, March 11, 2018 8:43:02 AM CET Doug Smythies wrote: > On 2018.03.10 15:55 Rafael J. Wysocki wrote: > >On Saturday, March 10, 2018 5:07:36 PM CET Doug Smythies wrote: > >> On 2018.03.10 01:00 Rafael J. Wysocki wrote: > > > ... [snip] ... > > > The information that they often spend more

Re: [RFC/RFT][PATCH v3 0/6] sched/cpuidle: Idle loop rework

2018-03-11 Thread Rafael J. Wysocki
On Sunday, March 11, 2018 8:43:02 AM CET Doug Smythies wrote: > On 2018.03.10 15:55 Rafael J. Wysocki wrote: > >On Saturday, March 10, 2018 5:07:36 PM CET Doug Smythies wrote: > >> On 2018.03.10 01:00 Rafael J. Wysocki wrote: > > > ... [snip] ... > > > The information that they often spend more

[PATCH] cpuidle: poll_state: Add time limit to poll_idle()

2018-03-11 Thread Rafael J. Wysocki
From: Rafael J. Wysocki If poll_idle() is allowed to spin until need_resched() returns 'true', it may actually spin for a much longer time than expected by the idle governor, since set_tsk_need_resched() is not always called by the timer interrupt handler. If that

[PATCH] cpuidle: poll_state: Add time limit to poll_idle()

2018-03-11 Thread Rafael J. Wysocki
From: Rafael J. Wysocki If poll_idle() is allowed to spin until need_resched() returns 'true', it may actually spin for a much longer time than expected by the idle governor, since set_tsk_need_resched() is not always called by the timer interrupt handler. If that happens, the CPU may spend

[GIT PULL] GPIO fixes for v4.16

2018-03-11 Thread Linus Walleij
Hi Linus, here is a singular fix for v4.16 and the Renesas RCAR driver. Please pull it in! Yours, Linus Walleij The following changes since commit 661e50bc853209e41a5c14a290ca4decc43cbfd1: Linux 4.16-rc4 (2018-03-04 14:54:11 -0800) are available in the Git repository at:

[GIT PULL] GPIO fixes for v4.16

2018-03-11 Thread Linus Walleij
Hi Linus, here is a singular fix for v4.16 and the Renesas RCAR driver. Please pull it in! Yours, Linus Walleij The following changes since commit 661e50bc853209e41a5c14a290ca4decc43cbfd1: Linux 4.16-rc4 (2018-03-04 14:54:11 -0800) are available in the Git repository at:

Re: [PATCH] ARM: BCM5301X: Fix NAND ECC parameters for Linksys Panamera

2018-03-11 Thread Vivek Unune
Hi Rafał, On Sat, Mar 10, 2018 at 10:41:04PM +0100, Rafał Miłecki wrote: > On 10 March 2018 at 18:12, Vivek Unune wrote: > > Using BCH8 gives ecc errors and makes the router unsuable. > > Switching to BCH1 fixes these errors. > > Can you provide CFE's log messages

Re: [PATCH] ARM: BCM5301X: Fix NAND ECC parameters for Linksys Panamera

2018-03-11 Thread Vivek Unune
Hi Rafał, On Sat, Mar 10, 2018 at 10:41:04PM +0100, Rafał Miłecki wrote: > On 10 March 2018 at 18:12, Vivek Unune wrote: > > Using BCH8 gives ecc errors and makes the router unsuable. > > Switching to BCH1 fixes these errors. > > Can you provide CFE's log messages starting with >

Re: [PATCH] x86/microcode/AMD: check microcode file sanity before loading it

2018-03-11 Thread Ingo Molnar
* Maciej S. Szmigiero wrote: > Currently, it is very easy to make the AMD microcode update driver crash > or spin on a malformed microcode file since it does very little > consistency checking on data loaded from such file. > > This commit introduces various checks,

Re: [PATCH] x86/microcode/AMD: check microcode file sanity before loading it

2018-03-11 Thread Ingo Molnar
* Maciej S. Szmigiero wrote: > Currently, it is very easy to make the AMD microcode update driver crash > or spin on a malformed microcode file since it does very little > consistency checking on data loaded from such file. > > This commit introduces various checks, mostly on length-type

[PATCH v2] x86: always use SYSCALL_DEFINE*

2018-03-11 Thread Tautschnig, Michael
All syscall arguments are passed in as types of the same byte size as unsigned long (width of full registers). Using a smaller type without a cast may result in losing bits of information. SYSCALL_DEFINE* introduce adequate type casts. All definitions of syscalls in x86 except for those patched

[PATCH v2] x86: always use SYSCALL_DEFINE*

2018-03-11 Thread Tautschnig, Michael
All syscall arguments are passed in as types of the same byte size as unsigned long (width of full registers). Using a smaller type without a cast may result in losing bits of information. SYSCALL_DEFINE* introduce adequate type casts. All definitions of syscalls in x86 except for those patched

Re: [GIT PULL rcu/next] RCU commits for 4.17

2018-03-11 Thread Ingo Molnar
* Paul E. McKenney wrote: > Hello, Ingo! > > This pull request contains the following changes: > > 1.Miscellaneous fixes, perhaps most notably removing obsolete > code whose only purpose in life was to gather information for > the now-removed RCU

Re: [GIT PULL rcu/next] RCU commits for 4.17

2018-03-11 Thread Ingo Molnar
* Paul E. McKenney wrote: > Hello, Ingo! > > This pull request contains the following changes: > > 1.Miscellaneous fixes, perhaps most notably removing obsolete > code whose only purpose in life was to gather information for > the now-removed RCU debugfs facility. Other

[Possible REGRESSION, 4.16-rc4] Error updating SMART data during runtime and could not connect to lvmetad at some boot attempts

2018-03-11 Thread Martin Steigerwald
Hello. Since 4.16-rc4 (upgraded from 4.15.2 which worked) I have an issue with SMART checks occassionally failing like this: smartd[28017]: Device: /dev/sdb [SAT], is in SLEEP mode, suspending checks udisksd[24408]: Error performing housekeeping for drive

[Possible REGRESSION, 4.16-rc4] Error updating SMART data during runtime and could not connect to lvmetad at some boot attempts

2018-03-11 Thread Martin Steigerwald
Hello. Since 4.16-rc4 (upgraded from 4.15.2 which worked) I have an issue with SMART checks occassionally failing like this: smartd[28017]: Device: /dev/sdb [SAT], is in SLEEP mode, suspending checks udisksd[24408]: Error performing housekeeping for drive

[PATCH] powerpc: Use common error handling code in setup_new_fdt()

2018-03-11 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 11 Mar 2018 09:03:42 +0100 Add a jump target so that a bit of exception handling can be better reused at the end of this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring

[PATCH] powerpc: Use common error handling code in setup_new_fdt()

2018-03-11 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 11 Mar 2018 09:03:42 +0100 Add a jump target so that a bit of exception handling can be better reused at the end of this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring ---

[PATCH v4] mtdchar: fix usage of mtd_ooblayout_ecc()

2018-03-11 Thread OuYang ZhiZhong
Section was not properly computed. The value of OOB region definition is always ECC section 0 information in the OOB area, but we want to get all the ECC bytes information, so we should call mtd_ooblayout_ecc(mtd, section++, ) until it returns -ERANGE. Fixes: c2b78452a9db ("mtd: use

[PATCH v4] mtdchar: fix usage of mtd_ooblayout_ecc()

2018-03-11 Thread OuYang ZhiZhong
Section was not properly computed. The value of OOB region definition is always ECC section 0 information in the OOB area, but we want to get all the ECC bytes information, so we should call mtd_ooblayout_ecc(mtd, section++, ) until it returns -ERANGE. Fixes: c2b78452a9db ("mtd: use

<    5   6   7   8   9   10