From: "H. Peter Anvin" <hpa@zytor.com>
To: Ulrich Drepper <drepper@redhat.com>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
mingo@elte.hu, tglx@linutronix.de, torvalds@linux-foundation.org
Subject: Re: [PATCHv3 0/4] sys_indirect system call
Date: Sat, 17 Nov 2007 23:44:31 -0800 [thread overview]
Message-ID: <473FED5F.2010303@zytor.com> (raw)
In-Reply-To: <200711170531.lAH5VaXR025225@devserv.devel.redhat.com>
Ulrich Drepper wrote:
> wing patches provide an alternative implementation of the
> sys_indirect system call which has been discussed a few times.
> This no system call allows us to extend existing system call
> interfaces with adding more system calls.
>
> Davide's previous implementation is IMO far more complex than
> warranted. This code here is trivial, as you can see. I've
> discussed this approach with Linus last week and for a brief moment
> we actually agreed on something.
>
> We pass an additional block of data to the kernel, it is copied into
> the task_struct, and then it is up to the function implementing the system
> call to interpret the data. Each system call, which is meant to be
> extended this way, has to be white-listed in sys_indirect. The
> alternative is to filter out those system calls which absolutely cannot
> be handled using sys_indirect (like clone, execve) since they require
> the stack layout of an ordinary system call. This is more dangerous
> since it is too easy to miss a call.
>
I stared at this a bit, and it took me some time to try to grok what it
is trying to do. Eventually I figured it out, and I wonder if there
isn't an easier -- or at least more efficient -- way to accomplish this
goal.
It seems to me that we could accomplish the same thing by passing the
number of parameters in the upper bits of the system call number
register (%eax in the case of x86.) If set to zero, we'd fill in the
legacy number of registers (for backwards compatibility.) Unspecified
arguments are then forced to zero before invoking the target function;
we could also make a register count available if need be.
Alternatively, the same thing can be done with a dense system call
number space by adding a number of parameters field to the system call
table, however, that is more invasive in that one has to poke something
into each architecture (unfortunately -- it would be so much nicer if
there was a central metafile which one could process into the various
architecture system call tables.)
-hpa
next prev parent reply other threads:[~2007-11-18 7:46 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-17 5:31 [PATCHv3 0/4] sys_indirect system call Ulrich Drepper
2007-11-18 7:44 ` H. Peter Anvin [this message]
2007-11-18 9:36 ` Ulrich Drepper
2007-11-18 19:37 ` H. Peter Anvin
2007-11-20 3:28 ` Ulrich Drepper
2007-11-20 4:27 ` H. Peter Anvin
2007-11-19 13:52 ` Eric Dumazet
2007-11-19 15:12 ` Ulrich Drepper
2007-11-19 15:43 ` Eric Dumazet
2007-11-19 15:48 ` Ulrich Drepper
2007-11-19 16:14 ` Eric Dumazet
2007-11-19 19:08 ` Ingo Molnar
2007-11-20 14:11 ` dean gaudet
2007-11-20 16:16 ` Ulrich Drepper
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=473FED5F.2010303@zytor.com \
--to=hpa@zytor.com \
--cc=akpm@linux-foundation.org \
--cc=drepper@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
--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