All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
	Jeff Dike <jdike@addtoit.com>,
	Bjoern Steinbrink <B.Steinbrink@gmx.de>,
	Arjan van de Ven <arjan@infradead.org>,
	Chase Venters <chase.venters@clientec.com>,
	Andrew Morton <akpm@osdl.org>,
	David Howells <dhowells@redhat.com>, Andi Kleen <ak@suse.de>,
	"H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [PATCH 3/6] provide kernel_execve on all architectures
Date: Wed, 30 Aug 2006 16:16:37 +0200	[thread overview]
Message-ID: <1156947397.18390.4.camel@localhost> (raw)
In-Reply-To: <20060830125037.876668000@klappe.arndb.de>

On Wed, 2006-08-30 at 14:43 +0200, Arnd Bergmann wrote:
> This adds the new kernel_execve function on all architectures
> that were using _syscall3() to implement execve.

Doesn't compile for s390. Patch attached, issues fixed:
1) Include unistd.h for __NR_execve
2) The compiler warns about __arg2 and __arg3 assignments (watch out for
the *const* - isn't C a lovely language ;-)
3) The inline assembly does not clobber register "1", nor the condition
code. The call to kernel_execve does clobber both so it is not really a
problem, but nit-picking is fun >:-)

-- 
blue skies,
  Martin.

Martin Schwidefsky
Linux for zSeries Development & Services
IBM Deutschland Entwicklung GmbH

"Reality continues to ruin my life." - Calvin.

---
diff -urpN linux-2.6/arch/s390/kernel/sys_s390.c linux-2.6-patched/arch/s390/kernel/sys_s390.c
--- linux-2.6/arch/s390/kernel/sys_s390.c	2006-08-30 15:23:14.000000000 +0200
+++ linux-2.6-patched/arch/s390/kernel/sys_s390.c	2006-08-30 15:18:37.000000000 +0200
@@ -27,6 +27,7 @@
 #include <linux/file.h>
 #include <linux/utsname.h>
 #include <linux/personality.h>
+#include <linux/unistd.h>
 
 #include <asm/uaccess.h>
 #include <asm/ipc.h>
@@ -273,14 +274,15 @@ s390_fadvise64_64(struct fadvise64_64_ar
 int kernel_execve(const char *filename, char *const argv[], char *const envp[])
 {
 	register const char *__arg1 asm("2") = filename;
-	register void *__arg2 asm("3") = argv;
-	register void *__arg3 asm("4") = envp;
+	register char *const*__arg2 asm("3") = argv;
+	register char *const*__arg3 asm("4") = envp;
 	register long __svcres asm("2");
-	asm volatile ("svc %b1"
+	asm volatile(
+		"svc %b1"
 		: "=d" (__svcres)
 		: "i" (__NR_execve),
 		  "0" (__arg1),
 		  "d" (__arg2),
-		  "d" (__arg3) : "1", "cc", "memory");
+		  "d" (__arg3) : "memory");
 	return __svcres;
 }



  reply	other threads:[~2006-08-30 14:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-30 12:43 [PATCH 0/6] kill __KERNEL_SYSCALLS__, try #3 Arnd Bergmann
2006-08-30 12:43 ` [PATCH 1/6] introduce kernel_execve Arnd Bergmann
2006-08-30 12:43 ` [PATCH 2/6] rename the provided execve functions to kernel_execve Arnd Bergmann
2006-08-30 21:47   ` Paul Mackerras
2006-08-30 12:43 ` [PATCH 3/6] provide kernel_execve on all architectures Arnd Bergmann
2006-08-30 14:16   ` Martin Schwidefsky [this message]
2006-08-30 12:44 ` [PATCH 4/6] Remove the use of _syscallX macros in UML Arnd Bergmann
2006-08-30 12:44 ` [PATCH 5/6] sh64: remove the use of kernel syscalls Arnd Bergmann, Paul Mundt
2006-08-30 13:11   ` Arnd Bergmann
2006-08-30 12:44 ` [PATCH 6/6] remove remaining errno and __KERNEL_SYSCALLS__ references Arnd Bergmann
2006-08-30 13:12 ` [PATCH 0/6] kill __KERNEL_SYSCALLS__, try #3 David Howells

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=1156947397.18390.4.camel@localhost \
    --to=schwidefsky@de.ibm.com \
    --cc=B.Steinbrink@gmx.de \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=arjan@infradead.org \
    --cc=arnd@arndb.de \
    --cc=chase.venters@clientec.com \
    --cc=dhowells@redhat.com \
    --cc=hpa@zytor.com \
    --cc=jdike@addtoit.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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 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.