mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Davide Libenzi <davidel@xmailserver.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Oleg Nesterov <oleg@tv-sign.ru>
Subject: Re: [patch 5/13] signal/timer/event fds v6 - signalfd compat code ...
Date: Sun, 18 Mar 2007 13:42:42 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0703181340020.5482@alien.or.mcafeemobile.com> (raw)
In-Reply-To: <200703172247.51602.arnd@arndb.de>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1345 bytes --]

On Sat, 17 Mar 2007, Arnd Bergmann wrote:

> On Friday 16 March 2007 01:22:15 Davide Libenzi wrote:
> > +asmlinkage long compat_sys_signalfd(int ufd,
> > +                                   const compat_sigset_t __user *sigmask,
> > +                                   compat_size_t sigsetsize)
> > +{
> > +       compat_sigset_t ss32;
> > +       sigset_t tmp;
> > +       sigset_t __user *ksigmask;
> > +
> > +       if (sigsetsize != sizeof(compat_sigset_t))
> > +               return -EINVAL;
> > +       if (copy_from_user(&ss32, sigmask, sizeof(ss32)))
> > +               return -EFAULT;
> > +       sigset_from_compat(&tmp, &ss32);
> > +       ksigmask = compat_alloc_user_space(sizeof(sigset_t));
> > +       if (copy_to_user(ksigmask, &tmp, sizeof(sigset_t)))
> > +               return -EFAULT;
> > +
> > +       return sys_signalfd(ufd, ksigmask, sizeof(sigset_t));
> > +}
> 
> Doing the compat_alloc_user_space() magic obviously makes the 32 bit
> emulation code less efficient. How about having a
> 
> long do_signalfd(int ufd, const sigset_t *sigmask, size_t sigsetsize);
> 
> that is called directly by both sys_signalfd and compat_sys_signalfd?
> Same obviously applies also to do_timerfd.

Hmm,  copy_*_user (one or two moves) and compat_alloc_user_space are 
pretty fast...



- Davide


      parent reply	other threads:[~2007-03-18 20:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-16  0:22 Davide Libenzi
     [not found] ` <200703172247.51602.arnd@arndb.de>
2007-03-18 20:42   ` Davide Libenzi [this message]

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=Pine.LNX.4.64.0703181340020.5482@alien.or.mcafeemobile.com \
    --to=davidel@xmailserver.org \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@tv-sign.ru \
    --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®