All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Hogan <james.hogan@imgtec.com>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Nicolas Dichtel <nicolas.dichtel@6wind.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-arch@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	Tony Luck <tony.luck@intel.com>
Subject: Re: [RFC] making HAVE_SYSCALL_WRAPPERS universal (Re: Issues with "x86, um: switch to generic fork/vfork/clone" commit)
Date: Tue, 22 Jan 2013 12:47:17 +0000	[thread overview]
Message-ID: <50FE8A55.2000703@imgtec.com> (raw)
In-Reply-To: <20130121225517.GV4939@ZenIV.linux.org.uk>

On 21/01/13 22:55, Al Viro wrote:
> I've tried to sanitize cond_syscall/SYSCALL_ALIAS situation; the tree is in
> git.kernel.org/pub/scm/linux/kernel/git/viro/signal experimental-syscalls
> NOTE: this is absolutely untested and might very well blow up
> on any number of architectures.
> 
> Review and comments would be very welcome.

Looking at "consolidate cond_syscall and SYSCALL_ALIAS declarations",
is it worth having the default __SYMBOL_NAME declaration in
include/linux/linkage.h make use of CONFIG_SYMBOL_PREFIX?

E.g. in the metag patchset we currently have the patch below.

Admittedly CONFIG_SYMBOL_PREFIX is a string which would make it's use in
SYMBOL_NAME a bit awkward.

Cheers
James


Subject: [PATCH v3 02/44] asm-generic/unistd.h: handle symbol prefixes in
 cond_syscall

Some architectures have symbol prefixes and set CONFIG_SYMBOL_PREFIX,
but this wasn't taken into account by the generic cond_syscall. It's
easy enough to fix in a generic fashion, so add the symbol prefix to
symbol names in cond_syscall when CONFIG_SYMBOL_PREFIX is set.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>
---
 include/asm-generic/unistd.h |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/include/asm-generic/unistd.h b/include/asm-generic/unistd.h
index 257c55e..4077b5d 100644
--- a/include/asm-generic/unistd.h
+++ b/include/asm-generic/unistd.h
@@ -17,5 +17,12 @@
  * but it doesn't work on all toolchains, so we just do it by hand
  */
 #ifndef cond_syscall
-#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
+#ifdef CONFIG_SYMBOL_PREFIX
+#define __SYMBOL_PREFIX CONFIG_SYMBOL_PREFIX
+#else
+#define __SYMBOL_PREFIX
+#endif
+#define cond_syscall(x) asm(".weak\t" __SYMBOL_PREFIX #x "\n\t" \
+			    ".set\t" __SYMBOL_PREFIX #x "," \
+			    __SYMBOL_PREFIX "sys_ni_syscall")
 #endif
-- 
1.7.7.6

WARNING: multiple messages have this Message-ID (diff)
From: James Hogan <james.hogan@imgtec.com>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Nicolas Dichtel <nicolas.dichtel@6wind.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	<linux-arch@vger.kernel.org>, Arnd Bergmann <arnd@arndb.de>,
	Tony Luck <tony.luck@intel.com>
Subject: Re: [RFC] making HAVE_SYSCALL_WRAPPERS universal (Re: Issues with "x86, um: switch to generic fork/vfork/clone" commit)
Date: Tue, 22 Jan 2013 12:47:17 +0000	[thread overview]
Message-ID: <50FE8A55.2000703@imgtec.com> (raw)
In-Reply-To: <20130121225517.GV4939@ZenIV.linux.org.uk>

On 21/01/13 22:55, Al Viro wrote:
> I've tried to sanitize cond_syscall/SYSCALL_ALIAS situation; the tree is in
> git.kernel.org/pub/scm/linux/kernel/git/viro/signal experimental-syscalls
> NOTE: this is absolutely untested and might very well blow up
> on any number of architectures.
> 
> Review and comments would be very welcome.

Looking at "consolidate cond_syscall and SYSCALL_ALIAS declarations",
is it worth having the default __SYMBOL_NAME declaration in
include/linux/linkage.h make use of CONFIG_SYMBOL_PREFIX?

E.g. in the metag patchset we currently have the patch below.

Admittedly CONFIG_SYMBOL_PREFIX is a string which would make it's use in
SYMBOL_NAME a bit awkward.

Cheers
James


Subject: [PATCH v3 02/44] asm-generic/unistd.h: handle symbol prefixes in
 cond_syscall

Some architectures have symbol prefixes and set CONFIG_SYMBOL_PREFIX,
but this wasn't taken into account by the generic cond_syscall. It's
easy enough to fix in a generic fashion, so add the symbol prefix to
symbol names in cond_syscall when CONFIG_SYMBOL_PREFIX is set.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>
---
 include/asm-generic/unistd.h |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/include/asm-generic/unistd.h b/include/asm-generic/unistd.h
index 257c55e..4077b5d 100644
--- a/include/asm-generic/unistd.h
+++ b/include/asm-generic/unistd.h
@@ -17,5 +17,12 @@
  * but it doesn't work on all toolchains, so we just do it by hand
  */
 #ifndef cond_syscall
-#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
+#ifdef CONFIG_SYMBOL_PREFIX
+#define __SYMBOL_PREFIX CONFIG_SYMBOL_PREFIX
+#else
+#define __SYMBOL_PREFIX
+#endif
+#define cond_syscall(x) asm(".weak\t" __SYMBOL_PREFIX #x "\n\t" \
+			    ".set\t" __SYMBOL_PREFIX #x "," \
+			    __SYMBOL_PREFIX "sys_ni_syscall")
 #endif
-- 
1.7.7.6


  reply	other threads:[~2013-01-22 12:47 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-14  9:42 Issues with "x86, um: switch to generic fork/vfork/clone" commit Nicolas Dichtel
2013-01-19  6:38 ` Al Viro
2013-01-20  3:12   ` Al Viro
2013-01-20 20:53     ` Linus Torvalds
2013-01-20 21:28       ` Al Viro
2013-01-21  1:22       ` Al Viro
2013-01-21  1:40         ` Linus Torvalds
2013-01-21  2:30           ` Al Viro
2013-01-21  2:39             ` Linus Torvalds
2013-01-21  6:02               ` Al Viro
2013-01-21 22:55             ` [RFC] making HAVE_SYSCALL_WRAPPERS universal (Re: Issues with "x86, um: switch to generic fork/vfork/clone" commit) Al Viro
2013-01-22 12:47               ` James Hogan [this message]
2013-01-22 12:47                 ` James Hogan
2013-01-22 14:23                 ` Al Viro
2013-01-22 13:16               ` Arnd Bergmann
2013-01-22 15:33               ` Arnd Bergmann
2013-01-21  9:00     ` Issues with "x86, um: switch to generic fork/vfork/clone" commit Nicolas Dichtel

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=50FE8A55.2000703@imgtec.com \
    --to=james.hogan@imgtec.com \
    --cc=arnd@arndb.de \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolas.dichtel@6wind.com \
    --cc=tony.luck@intel.com \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@ZenIV.linux.org.uk \
    /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.