public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Chris Metcalf <cmetcalf@tilera.com>
Cc: linux-kernel@vger.kernel.org,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	"J. Bruce Fields" <bfields@redhat.com>, NeilBrown <neilb@suse.de>
Subject: Re: [PATCH] ipc: provide generic compat versions of IPC syscalls
Date: Fri, 9 Dec 2011 16:02:31 +0000	[thread overview]
Message-ID: <201112091602.31325.arnd@arndb.de> (raw)
In-Reply-To: <201112091536.pB9Fa5f7002738@farm-0002.internal.tilera.com>

On Friday 09 December 2011, Chris Metcalf wrote:
> 
> Several of the existing compat IPC syscalls are really just i386
> compatibility, not generic compatibility.  semctl() expects a
> pointer to the fourth argument, instead of the fourth argument itself.
> msgsnd(), msgrcv() and shmat() expect arguments in different order.
> 
> This change adds an __ARCH_WANT_GENERIC_COMPAT_IPC define that
> can be set in <asm/compat.h> to indicate that the IPC compat code
> should provide exactly the same APIs to "compat" users as the
> regular IPC code does to regular users.  In addition, it sets up
> to always request the IPC_64 mode, since that's what the <asm-generic>
> APIs always use.
> 
> The workaround code in "tile" for msgsnd() and msgrcv() is removed
> with this change; it fixes the bug that shmat() and semctl() were
> not also being properly converted to expect generic compat IPC.
> 
> Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>

I like the patch, but I think the __ARCH_WANT_GENERIC_COMPAT_IPC
should be defined as the opposite, so all "old" architectures
have to set it while tile (and future architectures like arm64
and unicore64) just get the default.

> Finding the shmat/semctl bugs in tilegx finally motivated me to go and
> do the thing he suggested 18 months ago. :-)  Whether someone wants to
> go a step further and actually move the i386-ish versions into arch/x86
> I will leave to the x86 platform maintainers; I also don't know whether,
> perhaps, some other platforms are actually using the i386 convention.

I don't see them as x86 specific. We have powerpc, mips, s390, sparc and
x86 using the legacy method, while only parisc and tile get it right
and use the syscalls directly.

	Arnd

  reply	other threads:[~2011-12-09 16:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-09 15:29 [PATCH] ipc: provide generic compat versions of IPC syscalls Chris Metcalf
2011-12-09 16:02 ` Arnd Bergmann [this message]
2011-12-09 15:29   ` [PATCH v2] " Chris Metcalf
2011-12-09 21:48     ` Andrew Morton
2011-12-09 23:21       ` Arnd Bergmann
2011-12-09 15:29         ` [PATCH v3] " Chris Metcalf
2012-03-15  1:24           ` Chris Metcalf
2012-03-15 16:25             ` Arnd Bergmann

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=201112091602.31325.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=akpm@linux-foundation.org \
    --cc=bfields@redhat.com \
    --cc=cmetcalf@tilera.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neilb@suse.de \
    /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