mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: linux@dominikbrodowski.net
Cc: linux-kernel@vger.kernel.org, torvalds@linux-foundation.org,
	netdev@vger.kernel.org
Subject: Re: [PATCH -next 00/22] remove in-kernel syscall invocations (part 2 == netdev)
Date: Fri, 16 Mar 2018 14:30:21 -0400 (EDT)	[thread overview]
Message-ID: <20180316.143021.1158193720540239477.davem@davemloft.net> (raw)
In-Reply-To: <20180316170614.5392-1-linux@dominikbrodowski.net>

From: Dominik Brodowski <linux@dominikbrodowski.net>
Date: Fri, 16 Mar 2018 18:05:52 +0100

> The rationale of this change is described in patch 1 of part 1[*] as follows:
> 
> 	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 which currently need to pretend to be
> 	userspace in order to make use of syscalls.
> 
> At present, these patches are based on v4.16-rc5; there is one trivial
> conflict against net-next. Dave, I presume that you prefer to take them
> through net-next? If you want to, I can re-base them against net-next.
> If you prefer otherwise, though, I can route them as part of my whole
> syscall series.

So the transformations themeselves are relatively trivial, so on that
aspect I don't have any problems with these changes.

But overall I have to wonder.

I imagine one of the things you'd like to do is declare that syscall
entries use a different (better) argument passing scheme.  For
example, passing values in registers instead of on the stack.

But in situations where you split out the system call function
completely into one of these "helpers", the compiler is going
to have two choices:

1) Expand the helper into the syscall function inline, thus we end up
   with two copies of the function.

2) Call the helper from the syscall function.  Well, then the compiler
   will need to pop the syscal obtained arguments from the registers
   onto the stack.

So this doesn't seem like such a total win to me.

Maybe you can explain things better to ease my concerns.

About merging, I'm fine with you taking this via your tree.  I do not
see there being any terribly difficult conflicts arising (famous
last words).

Thanks.

  parent reply	other threads:[~2018-03-16 18:30 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-16 17:05 Dominik Brodowski
2018-03-16 17:05 ` [PATCH -next 01/22] net: socket: add __sys_recvfrom() helper; remove in-kernel call to syscall Dominik Brodowski
2018-03-16 17:05 ` [PATCH -next 02/22] net: socket: add __sys_sendto() " Dominik Brodowski
2018-03-16 17:05 ` [PATCH -next 03/22] net: socket: add __sys_accept4() " Dominik Brodowski
2018-03-16 17:05 ` [PATCH -next 04/22] net: socket: add __sys_socket() " Dominik Brodowski
2018-03-16 17:05 ` [PATCH -next 05/22] net: socket: add __sys_bind() " Dominik Brodowski
2018-03-16 17:05 ` [PATCH -next 06/22] net: socket: add __sys_connect() " Dominik Brodowski
2018-03-16 17:05 ` [PATCH -next 07/22] net: socket: add __sys_listen() " Dominik Brodowski
2018-03-16 17:06 ` [PATCH -next 08/22] net: socket: add __sys_getsockname() " Dominik Brodowski
2018-03-16 17:06 ` [PATCH -next 09/22] net: socket: add __sys_getpeername() " Dominik Brodowski
2018-03-16 17:06 ` [PATCH -next 10/22] net: socket: add __sys_socketpair() " Dominik Brodowski
2018-03-16 17:06 ` [PATCH -next 11/22] net: socket: add __sys_shutdown() " Dominik Brodowski
2018-03-16 17:06 ` [PATCH -next 12/22] net: socket: add __sys_setsockopt() " Dominik Brodowski
2018-03-16 17:06 ` [PATCH -next 13/22] net: socket: add __sys_getsockopt() " Dominik Brodowski
2018-03-16 17:06 ` [PATCH -next 14/22] net: socket: add do_sys_recvmmsg() " Dominik Brodowski
2018-03-16 17:06 ` [PATCH -next 15/22] net: socket: move check for forbid_cmsg_compat to __sys_...msg() Dominik Brodowski
2018-03-16 17:06 ` [PATCH -next 16/22] net: socket: replace calls to sys_send() with __sys_sendto() Dominik Brodowski
2018-03-16 17:06 ` [PATCH -next 17/22] net: socket: replace call to sys_recv() with __sys_recvfrom() Dominik Brodowski
2018-03-16 17:06 ` [PATCH -next 18/22] net: socket: add __compat_sys_recvfrom() helper; remove in-kernel call to compat syscall Dominik Brodowski
2018-03-16 17:06 ` [PATCH -next 19/22] net: socket: add __compat_sys_setsockopt() " Dominik Brodowski
2018-03-16 17:06 ` [PATCH -next 20/22] net: socket: add __compat_sys_getsockopt() " Dominik Brodowski
2018-03-16 17:06 ` [PATCH -next 21/22] net: socket: add __compat_sys_recvmmsg() " Dominik Brodowski
2018-03-16 17:06 ` [PATCH -next 22/22] net: socket: add __compat_sys_...msg() helpers; remove in-kernel calls to compat syscalls Dominik Brodowski
2018-03-16 18:30 ` David Miller [this message]
2018-03-16 19:39   ` [PATCH -next 00/22] remove in-kernel syscall invocations (part 2 == netdev) Dominik Brodowski
2018-03-16 19:42   ` Linus Torvalds

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=20180316.143021.1158193720540239477.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@dominikbrodowski.net \
    --cc=netdev@vger.kernel.org \
    --cc=torvalds@linux-foundation.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

all inboxes | Powered by JetHome®