All of lore.kernel.org
 help / color / mirror / Atom feed
diff for duplicates of <20091113155647.GA22321@us.ibm.com>

diff --git a/a/1.txt b/N1/1.txt
index 151c1a0..cb9fa6f 100644
--- a/a/1.txt
+++ b/N1/1.txt
@@ -1,5 +1,5 @@
-Quoting Heiko Carstens (heiko.carstens-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org):
-> On Thu, Nov 12, 2009 at 11:21:20PM -0600, serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org wrote:
+Quoting Heiko Carstens (heiko.carstens@de.ibm.com):
+> On Thu, Nov 12, 2009 at 11:21:20PM -0600, serue@us.ibm.com wrote:
 > > +asmlinkage long sys32_eclone(void)
 > > +{
 > > +	int rc;
@@ -48,178 +48,3 @@ arch/s390/kernel/compat_wrapper.S.
 
 thanks,
 -serge
-
-From 6c0a067eb2048b33a313244a627a47ffff351928 Mon Sep 17 00:00:00 2001
-From: Serge E. Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
-Date: Fri, 6 Nov 2009 19:03:43 -0500
-Subject: [PATCH 1/1] implement s390 eclone syscall
-
-This patch implements the s390 hook for sys_eclone.
-
-The user-space clone-with-pids glue for s390 (clone_s390x.c
-from the user-cr package) is now:
-
-struct pid_set {
-	int num_pids;
-	pid_t *pids;
-};
-
- #define do_eclone(flags, pids, args, sz) \
-( { \
-  register unsigned long int __r1 asm ("1") = (unsigned long int)(__NR_eclone); \
-  register unsigned long int __r2 asm ("2") = (unsigned long int)(flags); \
-  register unsigned long int __r3 asm ("3") = (unsigned long int)(args); \
-  register unsigned long int __r4 asm ("4") = (unsigned long int)(sz); \
-  register unsigned long int __r5 asm ("5") = (unsigned long int)(pids); \
-  register long int __result asm ("2"); \
-  __asm__ __volatile__( \
-	  " svc 0\n" /* do __NR_eclone syscall */ \
-	  " ltgr %%r2,%%r2\n" /* returned 0? */ \
-	  " jnz 1f\n" /* if not goto label 1 */ \
-	  " lg %%r3,0(%%r15)\n"   /* get fnarg off stack into arg 1 */ \
-	  " lg %%r2,8(%%r15)\n"   /* get fn off stack int r3 basr*/ \
-	  " lgr %%r1,%%r15\n" /* tmp store old stack pointer */ \
-	  " aghi %%r15,-160\n" /* move the stack */ \
-	  " stg %%r1,0(%%r15)\n" /* and save old stack pointer */ \
-	  " basr %%r14,%%r3\n" /* call fn(arg) */ \
-	  " svc 1\n"  /* call exit */ \
-	  " 1:\n" \
-	  : "=d" (__result) \
-	  : "d" (__r1), "0" (__r2), "d" (__r3), "d" (__r4), "d" (__r5) \
-	  : "memory"); \
-	__result; \
-} )
-int clone_with_pids(int (*fn)(void *), void *child_stack, int flags,
-			struct pid_set *target_pids, void *arg)
-{
-	struct clone_args clone_args, *ca = &clone_args;
-	u64 *s;
-
-	memset(ca, 0, sizeof(struct clone_args));
-	ca->nr_pids = target_pids->num_pids;
-	if (!child_stack) {
-		/* we could pass in null and then in eclone not
-		 * call exit if child_stack was null, but we'll
-		 * just malloc here */
-		int sz = 4*getpagesize();
-		child_stack = malloc(sz);
-		if (!child_stack)
-			return -ENOMEM;
-		child_stack += sz; /* we'll decrement before assigning */
-	}
-	ca->child_stack = (u64) child_stack;
-	s = (u64 *) ca->child_stack;
-	*--s = (u64) arg;
-	*--s = (u64) fn;
-	ca->child_stack -= 16;
-	return do_eclone(flags, target_pids->pids, ca,
-				    sizeof(struct clone_args));
-}
-
-Changelog:
-	Nov 13: As suggested by Heiko, convert eclone to take its
-		parameters via registers.
-
-Signed-off-by: Serge E. Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
----
- arch/s390/include/asm/unistd.h    |    3 +-
- arch/s390/kernel/compat_wrapper.S |    8 +++++++
- arch/s390/kernel/process.c        |   40 +++++++++++++++++++++++++++++++++++++
- arch/s390/kernel/syscalls.S       |    1 +
- 4 files changed, 51 insertions(+), 1 deletions(-)
-
-diff --git a/arch/s390/include/asm/unistd.h b/arch/s390/include/asm/unistd.h
-index cb5232d..cbf6c7c 100644
---- a/arch/s390/include/asm/unistd.h
-+++ b/arch/s390/include/asm/unistd.h
-@@ -269,7 +269,8 @@
- #define	__NR_pwritev		329
- #define __NR_rt_tgsigqueueinfo	330
- #define __NR_perf_event_open	331
--#define NR_syscalls 332
-+#define __NR_eclone		332
-+#define NR_syscalls 333
- 
- /* 
-  * There are some system calls that are not present on 64 bit, some
-diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S
-index cbd9901..816ae61 100644
---- a/arch/s390/kernel/compat_wrapper.S
-+++ b/arch/s390/kernel/compat_wrapper.S
-@@ -1849,6 +1849,14 @@ sys_clone_wrapper:
- 	llgtr	%r5,%r5			# int *
- 	jg	sys_clone		# branch to system call
- 
-+	.globl	sys_eclone_wrapper
-+sys_eclone_wrapper:
-+	llgfr	%r2,%r2			# unsigned int
-+	llgtr	%r3,%r3			# struct clone_args *
-+	lgfr	%r4,%r4			# int
-+	llgtr	%r5,%r5			# pid_t *
-+	jg	sys_eclone		# branch to system call
-+
- 	.globl	sys32_execve_wrapper
- sys32_execve_wrapper:
- 	llgtr	%r2,%r2			# char *
-diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c
-index 5417eb5..817069e 100644
---- a/arch/s390/kernel/process.c
-+++ b/arch/s390/kernel/process.c
-@@ -241,6 +241,46 @@ SYSCALL_DEFINE4(clone, unsigned long, newsp, unsigned long, clone_flags,
- 		       parent_tidptr, child_tidptr);
- }
- 
-+SYSCALL_DEFINE4(eclone, unsigned int, flags_low, struct clone_args __user *,
-+		uca, int, args_size, pid_t __user *, pids)
-+{
-+	int rc;
-+	struct pt_regs *regs = task_pt_regs(current);
-+	struct clone_args kca;
-+	int __user *parent_tid_ptr;
-+	int __user *child_tid_ptr;
-+	unsigned long flags;
-+	unsigned long __user child_stack;
-+	unsigned long stack_size;
-+
-+	rc = fetch_clone_args_from_user(uca, args_size, &kca);
-+	if (rc)
-+		return rc;
-+
-+	if (kca.clone_flags_high)
-+		return -EINVAL;
-+
-+	flags = flags_low;
-+	parent_tid_ptr = (int __user *) kca.parent_tid_ptr;
-+	child_tid_ptr =  (int __user *) kca.child_tid_ptr;
-+
-+	stack_size = (unsigned long) kca.child_stack_size;
-+	if (stack_size)
-+		return -EINVAL;
-+
-+	child_stack = (unsigned long) kca.child_stack;
-+	if (!child_stack)
-+		child_stack = regs->gprs[15];
-+
-+	/*
-+	 * TODO: On 32-bit systems, clone_flags is passed in as 32-bit value
-+	 * 	 to several functions. Need to convert clone_flags to 64-bit.
-+	 */
-+	return do_fork_with_pids(flags, child_stack, regs, stack_size,
-+				parent_tid_ptr, child_tid_ptr, kca.nr_pids,
-+				pids);
-+}
-+
- /*
-  * This is trivial, and on the face of it looks like it
-  * could equally well be done in user mode.
-diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S
-index 30eca07..fb8708d 100644
---- a/arch/s390/kernel/syscalls.S
-+++ b/arch/s390/kernel/syscalls.S
-@@ -340,3 +340,4 @@ SYSCALL(sys_preadv,sys_preadv,compat_sys_preadv_wrapper)
- SYSCALL(sys_pwritev,sys_pwritev,compat_sys_pwritev_wrapper)
- SYSCALL(sys_rt_tgsigqueueinfo,sys_rt_tgsigqueueinfo,compat_sys_rt_tgsigqueueinfo_wrapper) /* 330 */
- SYSCALL(sys_perf_event_open,sys_perf_event_open,sys_perf_event_open_wrapper)
-+SYSCALL(sys_eclone,sys_eclone,sys_eclone_wrapper)
--- 
-1.6.1
diff --git a/a/content_digest b/N1/content_digest
index 8ab32db..d49e080 100644
--- a/a/content_digest
+++ b/N1/content_digest
@@ -1,16 +1,12 @@
- "ref\01258089682-9934-1-git-send-email-serue@us.ibm.com\0"
  "ref\020091113084730.GA4839@osiris.boeblingen.de.ibm.com\0"
- "ref\020091113084730.GA4839-Pmgahw53EmNLmI7Nx2oIsGnsbthNF6/HVpNB7YpNyf8@public.gmane.org\0"
- "From\0Serge E. Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>\0"
+ "From\0Serge E. Hallyn <serue@us.ibm.com>\0"
  "Subject\0Re: [PATCH linux-cr] implement s390 eclone syscall\0"
- "Date\0Fri, 13 Nov 2009 09:56:47 -0600\0"
- "To\0Heiko Carstens <heiko.carstens-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>\0"
- "Cc\0Linux Containers <containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org>"
- " linux-s390-u79uwXL29TY76Z2rM5mHXA@public.gmane.org\0"
+ "Date\0Fri, 13 Nov 2009 15:56:47 +0000\0"
+ "To\0linux-s390@vger.kernel.org\0"
  "\00:1\0"
  "b\0"
- "Quoting Heiko Carstens (heiko.carstens-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org):\n"
- "> On Thu, Nov 12, 2009 at 11:21:20PM -0600, serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org wrote:\n"
+ "Quoting Heiko Carstens (heiko.carstens@de.ibm.com):\n"
+ "> On Thu, Nov 12, 2009 at 11:21:20PM -0600, serue@us.ibm.com wrote:\n"
  "> > +asmlinkage long sys32_eclone(void)\n"
  "> > +{\n"
  "> > +\tint rc;\n"
@@ -58,181 +54,6 @@
  "arch/s390/kernel/compat_wrapper.S.\n"
  "\n"
  "thanks,\n"
- "-serge\n"
- "\n"
- "From 6c0a067eb2048b33a313244a627a47ffff351928 Mon Sep 17 00:00:00 2001\n"
- "From: Serge E. Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>\n"
- "Date: Fri, 6 Nov 2009 19:03:43 -0500\n"
- "Subject: [PATCH 1/1] implement s390 eclone syscall\n"
- "\n"
- "This patch implements the s390 hook for sys_eclone.\n"
- "\n"
- "The user-space clone-with-pids glue for s390 (clone_s390x.c\n"
- "from the user-cr package) is now:\n"
- "\n"
- "struct pid_set {\n"
- "\tint num_pids;\n"
- "\tpid_t *pids;\n"
- "};\n"
- "\n"
- " #define do_eclone(flags, pids, args, sz) \\\n"
- "( { \\\n"
- "  register unsigned long int __r1 asm (\"1\") = (unsigned long int)(__NR_eclone); \\\n"
- "  register unsigned long int __r2 asm (\"2\") = (unsigned long int)(flags); \\\n"
- "  register unsigned long int __r3 asm (\"3\") = (unsigned long int)(args); \\\n"
- "  register unsigned long int __r4 asm (\"4\") = (unsigned long int)(sz); \\\n"
- "  register unsigned long int __r5 asm (\"5\") = (unsigned long int)(pids); \\\n"
- "  register long int __result asm (\"2\"); \\\n"
- "  __asm__ __volatile__( \\\n"
- "\t  \" svc 0\\n\" /* do __NR_eclone syscall */ \\\n"
- "\t  \" ltgr %%r2,%%r2\\n\" /* returned 0? */ \\\n"
- "\t  \" jnz 1f\\n\" /* if not goto label 1 */ \\\n"
- "\t  \" lg %%r3,0(%%r15)\\n\"   /* get fnarg off stack into arg 1 */ \\\n"
- "\t  \" lg %%r2,8(%%r15)\\n\"   /* get fn off stack int r3 basr*/ \\\n"
- "\t  \" lgr %%r1,%%r15\\n\" /* tmp store old stack pointer */ \\\n"
- "\t  \" aghi %%r15,-160\\n\" /* move the stack */ \\\n"
- "\t  \" stg %%r1,0(%%r15)\\n\" /* and save old stack pointer */ \\\n"
- "\t  \" basr %%r14,%%r3\\n\" /* call fn(arg) */ \\\n"
- "\t  \" svc 1\\n\"  /* call exit */ \\\n"
- "\t  \" 1:\\n\" \\\n"
- "\t  : \"=d\" (__result) \\\n"
- "\t  : \"d\" (__r1), \"0\" (__r2), \"d\" (__r3), \"d\" (__r4), \"d\" (__r5) \\\n"
- "\t  : \"memory\"); \\\n"
- "\t__result; \\\n"
- "} )\n"
- "int clone_with_pids(int (*fn)(void *), void *child_stack, int flags,\n"
- "\t\t\tstruct pid_set *target_pids, void *arg)\n"
- "{\n"
- "\tstruct clone_args clone_args, *ca = &clone_args;\n"
- "\tu64 *s;\n"
- "\n"
- "\tmemset(ca, 0, sizeof(struct clone_args));\n"
- "\tca->nr_pids = target_pids->num_pids;\n"
- "\tif (!child_stack) {\n"
- "\t\t/* we could pass in null and then in eclone not\n"
- "\t\t * call exit if child_stack was null, but we'll\n"
- "\t\t * just malloc here */\n"
- "\t\tint sz = 4*getpagesize();\n"
- "\t\tchild_stack = malloc(sz);\n"
- "\t\tif (!child_stack)\n"
- "\t\t\treturn -ENOMEM;\n"
- "\t\tchild_stack += sz; /* we'll decrement before assigning */\n"
- "\t}\n"
- "\tca->child_stack = (u64) child_stack;\n"
- "\ts = (u64 *) ca->child_stack;\n"
- "\t*--s = (u64) arg;\n"
- "\t*--s = (u64) fn;\n"
- "\tca->child_stack -= 16;\n"
- "\treturn do_eclone(flags, target_pids->pids, ca,\n"
- "\t\t\t\t    sizeof(struct clone_args));\n"
- "}\n"
- "\n"
- "Changelog:\n"
- "\tNov 13: As suggested by Heiko, convert eclone to take its\n"
- "\t\tparameters via registers.\n"
- "\n"
- "Signed-off-by: Serge E. Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>\n"
- "---\n"
- " arch/s390/include/asm/unistd.h    |    3 +-\n"
- " arch/s390/kernel/compat_wrapper.S |    8 +++++++\n"
- " arch/s390/kernel/process.c        |   40 +++++++++++++++++++++++++++++++++++++\n"
- " arch/s390/kernel/syscalls.S       |    1 +\n"
- " 4 files changed, 51 insertions(+), 1 deletions(-)\n"
- "\n"
- "diff --git a/arch/s390/include/asm/unistd.h b/arch/s390/include/asm/unistd.h\n"
- "index cb5232d..cbf6c7c 100644\n"
- "--- a/arch/s390/include/asm/unistd.h\n"
- "+++ b/arch/s390/include/asm/unistd.h\n"
- "@@ -269,7 +269,8 @@\n"
- " #define\t__NR_pwritev\t\t329\n"
- " #define __NR_rt_tgsigqueueinfo\t330\n"
- " #define __NR_perf_event_open\t331\n"
- "-#define NR_syscalls 332\n"
- "+#define __NR_eclone\t\t332\n"
- "+#define NR_syscalls 333\n"
- " \n"
- " /* \n"
- "  * There are some system calls that are not present on 64 bit, some\n"
- "diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S\n"
- "index cbd9901..816ae61 100644\n"
- "--- a/arch/s390/kernel/compat_wrapper.S\n"
- "+++ b/arch/s390/kernel/compat_wrapper.S\n"
- "@@ -1849,6 +1849,14 @@ sys_clone_wrapper:\n"
- " \tllgtr\t%r5,%r5\t\t\t# int *\n"
- " \tjg\tsys_clone\t\t# branch to system call\n"
- " \n"
- "+\t.globl\tsys_eclone_wrapper\n"
- "+sys_eclone_wrapper:\n"
- "+\tllgfr\t%r2,%r2\t\t\t# unsigned int\n"
- "+\tllgtr\t%r3,%r3\t\t\t# struct clone_args *\n"
- "+\tlgfr\t%r4,%r4\t\t\t# int\n"
- "+\tllgtr\t%r5,%r5\t\t\t# pid_t *\n"
- "+\tjg\tsys_eclone\t\t# branch to system call\n"
- "+\n"
- " \t.globl\tsys32_execve_wrapper\n"
- " sys32_execve_wrapper:\n"
- " \tllgtr\t%r2,%r2\t\t\t# char *\n"
- "diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c\n"
- "index 5417eb5..817069e 100644\n"
- "--- a/arch/s390/kernel/process.c\n"
- "+++ b/arch/s390/kernel/process.c\n"
- "@@ -241,6 +241,46 @@ SYSCALL_DEFINE4(clone, unsigned long, newsp, unsigned long, clone_flags,\n"
- " \t\t       parent_tidptr, child_tidptr);\n"
- " }\n"
- " \n"
- "+SYSCALL_DEFINE4(eclone, unsigned int, flags_low, struct clone_args __user *,\n"
- "+\t\tuca, int, args_size, pid_t __user *, pids)\n"
- "+{\n"
- "+\tint rc;\n"
- "+\tstruct pt_regs *regs = task_pt_regs(current);\n"
- "+\tstruct clone_args kca;\n"
- "+\tint __user *parent_tid_ptr;\n"
- "+\tint __user *child_tid_ptr;\n"
- "+\tunsigned long flags;\n"
- "+\tunsigned long __user child_stack;\n"
- "+\tunsigned long stack_size;\n"
- "+\n"
- "+\trc = fetch_clone_args_from_user(uca, args_size, &kca);\n"
- "+\tif (rc)\n"
- "+\t\treturn rc;\n"
- "+\n"
- "+\tif (kca.clone_flags_high)\n"
- "+\t\treturn -EINVAL;\n"
- "+\n"
- "+\tflags = flags_low;\n"
- "+\tparent_tid_ptr = (int __user *) kca.parent_tid_ptr;\n"
- "+\tchild_tid_ptr =  (int __user *) kca.child_tid_ptr;\n"
- "+\n"
- "+\tstack_size = (unsigned long) kca.child_stack_size;\n"
- "+\tif (stack_size)\n"
- "+\t\treturn -EINVAL;\n"
- "+\n"
- "+\tchild_stack = (unsigned long) kca.child_stack;\n"
- "+\tif (!child_stack)\n"
- "+\t\tchild_stack = regs->gprs[15];\n"
- "+\n"
- "+\t/*\n"
- "+\t * TODO: On 32-bit systems, clone_flags is passed in as 32-bit value\n"
- "+\t * \t to several functions. Need to convert clone_flags to 64-bit.\n"
- "+\t */\n"
- "+\treturn do_fork_with_pids(flags, child_stack, regs, stack_size,\n"
- "+\t\t\t\tparent_tid_ptr, child_tid_ptr, kca.nr_pids,\n"
- "+\t\t\t\tpids);\n"
- "+}\n"
- "+\n"
- " /*\n"
- "  * This is trivial, and on the face of it looks like it\n"
- "  * could equally well be done in user mode.\n"
- "diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S\n"
- "index 30eca07..fb8708d 100644\n"
- "--- a/arch/s390/kernel/syscalls.S\n"
- "+++ b/arch/s390/kernel/syscalls.S\n"
- "@@ -340,3 +340,4 @@ SYSCALL(sys_preadv,sys_preadv,compat_sys_preadv_wrapper)\n"
- " SYSCALL(sys_pwritev,sys_pwritev,compat_sys_pwritev_wrapper)\n"
- " SYSCALL(sys_rt_tgsigqueueinfo,sys_rt_tgsigqueueinfo,compat_sys_rt_tgsigqueueinfo_wrapper) /* 330 */\n"
- " SYSCALL(sys_perf_event_open,sys_perf_event_open,sys_perf_event_open_wrapper)\n"
- "+SYSCALL(sys_eclone,sys_eclone,sys_eclone_wrapper)\n"
- "-- \n"
- 1.6.1
+ -serge
 
-19776dd6889fc4b00cc4e6c50774fff0c947468f53050185156526806fe1569c
+32a7782e7b54ff53cf9d6b97c512fb01f2f741df124b0d509091fe9a3b6be300

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.