From: Davide Libenzi <davidel@xmailserver.org>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Andrew Morton <akpm@linux-foundation.org>,
David Woodhouse <dwmw2@infradead.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-arch@vger.kernel.org
Subject: Re: [patch] (2nd try) add epoll compat code to kernel/compat.c ...
Date: Mon, 12 Feb 2007 23:26:42 -0800 (PST) [thread overview]
Message-ID: <Pine.LNX.4.64.0702122321570.30273@alien.or.mcafeemobile.com> (raw)
In-Reply-To: <20070213153525.c1440cff.sfr@canb.auug.org.au>
On Tue, 13 Feb 2007, Stephen Rothwell wrote:
> A better way here might be to have each 64 bit architecture define
> compat_epoll_event in its asm/compat.h and then you can just use:
>
> if (copy_from_user(&user, event, sizeof(user)))
> return -EFAULT;
> kernel = compat_alloc_user_space(sizeof(struct epoll_event));
> err |= __put_user(user.events, &kernel->events);
> err |= __put_user(user.data, &kernel->data);
>
> And you shouldn't need the compat routine if
> offsetof(struct compat_epoll_event, data) == offsetof(struct epoll_event, data).
That is *definitely* better, because at that point you can make them also
define a NEED_COMPAT_EPOLL_{CTL,WAIT}, and that code can be excluded
altogether if not needed. I simply wanted to reduce work for arch
maintainers, but I'm all for something like the above.
> OK, I have thought about this some more and I *think* the only
> architecture that needs compat_sys_epoll_ctl or compat_sys_epoll_wait is
> ia64 where the 64 bit version of struct epoll_event is different from the
> 32 bit version. On x86_64, the struct is explictly packed (so it is the
> same as the 32 bit version) and on all the other 64 bit architectures the
> alignment of the u64 is the same as the equivalent 32 bit version.
>
> Since ia64 already has its own version of these two, we only have to
> worry about epoll_pwait and then the struct epoll_event is only a problem
> for ia64.
>
> Am I right? (I have cc'd linux-arch for guidance.)
ARM-OABI also defines them, dunno why. Rmk?
- Davide
next prev parent reply other threads:[~2007-02-13 7:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-12 0:24 Davide Libenzi
2007-02-13 4:35 ` Stephen Rothwell
2007-02-13 7:26 ` Davide Libenzi [this message]
2007-02-13 10:11 ` Stephen Rothwell
2007-02-13 14:43 ` James Bottomley
2007-02-13 23:17 ` Stephen Rothwell
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.0702122321570.30273@alien.or.mcafeemobile.com \
--to=davidel@xmailserver.org \
--cc=akpm@linux-foundation.org \
--cc=dwmw2@infradead.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
/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®