mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Ulrich Drepper" <drepper@gmail.com>
To: "Davide Libenzi" <davidel@xmailserver.org>
Cc: "Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Linus Torvalds" <torvalds@linux-foundation.org>,
	"Ingo Molnar" <mingo@elte.hu>
Subject: Re: [patch 0/6] sys_indirect RFC - sys_indirect introduction
Date: Fri, 29 Jun 2007 18:48:07 -0700	[thread overview]
Message-ID: <a36005b50706291848p406fbb9aw99697f609b0d5c4b@mail.gmail.com> (raw)
In-Reply-To: <send-serie.davidel@xmailserver.org.28360.1183153732.0>

On 6/29/07, Davide Libenzi <davidel@xmailserver.org> wrote:
> [include/linux/indirect.h]
>         #define SYSIND_CTX_OPENFLAGS    0
>         struct sysind_ctx_OPENFLAGS {
>                 __u32 ctx;
>                 __u32 flags;

I agree that this interface is more than any other in danger of
needing an interface change.  But I think your solution is a bit too
expensive and complex.  You need two reads from userlevel.

The standard way to handle this is a versioned struct.  I.e., define a
struct for the current needs, define an initial version.  To use the
syscall pass the version number and the struct pointer to the syscall.
 If the kernel doesn't know the version number it fails.  Otherwise it
might have to read old versions of the struct which is trivial to do.
E.g.:

#define SYSIND_VERSION 1
#define SYSIND_CTX_OPENFLAGS 0
#define SYSIND_CTX_SIGMASK 1
struct sysind_ctx {
  int ctx;
  union {
    int flags;
    kernel_sigset_t  sset;
  };
};

long sys_indirect(unsigned int nr,
                       int ctx_version,
                       const struct indirect_ctx *ctx,
                       const unsigned long *params);


This reduces the number of accesses to userlevel data to one and still
has all the flexibility needed.

  reply	other threads:[~2007-06-30  1:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-29 21:48 Davide Libenzi
2007-06-30  1:48 ` Ulrich Drepper [this message]
2007-06-30 19:23   ` Davide Libenzi
2007-06-30 21:54     ` Ulrich Drepper
2007-06-30 22:27       ` Davide Libenzi
2007-06-30 22:32         ` Davide Libenzi
2007-07-01 16:25           ` Ulrich Drepper
2007-07-01 17:09             ` Davide Libenzi
2007-07-02 14:09               ` Ulrich Drepper
2007-07-02 22:37                 ` Davide Libenzi
2007-07-03  0:28                   ` Ulrich Drepper
2007-07-03  0:37                     ` Davide Libenzi

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=a36005b50706291848p406fbb9aw99697f609b0d5c4b@mail.gmail.com \
    --to=drepper@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=davidel@xmailserver.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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®