All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiko Carstens <heiko.carstens@de.ibm.com>
To: Davide Libenzi <davidel@xmailserver.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	David Woodhouse <dwmw2@infradead.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>
Subject: Re: [patch] add epoll compat code to kernel/compat.c ...
Date: Sun, 11 Feb 2007 22:47:34 +0100	[thread overview]
Message-ID: <20070211214734.GB8631@osiris.ibm.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0702111155180.24568@alien.or.mcafeemobile.com>

On Sun, Feb 11, 2007 at 12:15:24PM -0800, Davide Libenzi wrote:
> 
> Add epoll compat_ code to kernel/compat.c. IA64 and ARM-OABI are currently 
> using their own version of epoll compat_ code and they could probably wire 
> to the new common code. Patch over 2.6.20.
> + * epoll (fs/eventpoll.c) compat bits follow ...
> + */
> +struct compat_epoll_event {
> +	u32 events;
> +	u32 data[2];
> +};
> +
>[...]
> +
> + * We need the compat layer over the epoll_event structure, only if the offset
> + * of the __u64 data member is not 4 (size of the events member that precedes the
> + * data one).
> + */
> +#define EPOLL_NEED_EVENT_COMPAT() (offsetof(struct epoll_event, data) != 4)

With

struct epoll_event {
        __u32 events;
        __u64 data;
};

this won't work on s390. offsetof(struct epoll_event, data) is 8 on both
31 bit and 64 bit. So it will do the conversion and corrupt all the data.
Actually we would only need the compat conversion for the sigset_t stuff.

But then again I thought most 32 bit architectures would add a 4 byte
pad between events and data, no?

Maybe we need some arch dependent struct compat_epoll_event and have
something like
#define EPOLL_NEED_EVENT_COMPAT() \
(offsetof(struct epoll_event, data) != offsetof(struct compat_epoll_event, data))

?

  reply	other threads:[~2007-02-11 21:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-11 20:15 [patch] add epoll compat code to kernel/compat.c Davide Libenzi
2007-02-11 21:47 ` Heiko Carstens [this message]
2007-02-11 23:18   ` 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=20070211214734.GB8631@osiris.ibm.com \
    --to=heiko.carstens@de.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=davidel@xmailserver.org \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=schwidefsky@de.ibm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.