All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] s390: clone_with_pids: fix compat wrapper
@ 2009-06-22 15:30 Serge E. Hallyn
       [not found] ` <20090622153052.GA32517-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Serge E. Hallyn @ 2009-06-22 15:30 UTC (permalink / raw)
  To: Oren Laadan; +Cc: Linux Containers, Martin Schwidefsky

Martin Schwidefsky pointed out two problems with my compat
wrapper.  Define sys32_clone_with_pids() in compat_linux.c
instead of using a syscall wrapper.

Signed-off-by: Serge E. Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
---
 arch/s390/kernel/compat_linux.c   |   19 +++++++++++++++++++
 arch/s390/kernel/compat_wrapper.S |   10 ----------
 2 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c
index 002c70d..cb4a304 100644
--- a/arch/s390/kernel/compat_linux.c
+++ b/arch/s390/kernel/compat_linux.c
@@ -821,6 +821,25 @@ asmlinkage long sys32_clone(void)
 		       parent_tidptr, child_tidptr);
 }
 
+asmlinkage long sys32_clone_with_pids(void)
+{
+	struct pt_regs *regs = task_pt_regs(current);
+	unsigned long clone_flags;
+	unsigned long newsp;
+	int __user *parent_tidptr, *child_tidptr;
+	void __user *upid_setp;
+
+	clone_flags = regs->gprs[3] & 0xffffffffUL;
+	newsp = regs->orig_gpr2 & 0x7fffffffUL;
+	parent_tidptr = compat_ptr(regs->gprs[4]);
+	child_tidptr = compat_ptr(regs->gprs[5]);
+	upid_setp = compat_ptr(regs->gprs[7]);
+	if (!newsp)
+		newsp = regs->gprs[15];
+	return do_fork_with_pids(clone_flags, newsp, regs, 0,
+		       parent_tidptr, child_tidptr, upid_setp);
+}
+
 /*
  * 31 bit emulation wrapper functions for sys_fadvise64/fadvise64_64.
  * These need to rewrite the advise values for POSIX_FADV_{DONTNEED,NOREUSE}
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S
index bf13315..c2228b2 100644
--- a/arch/s390/kernel/compat_wrapper.S
+++ b/arch/s390/kernel/compat_wrapper.S
@@ -1837,13 +1837,3 @@ sys_restore_wrapper:
 	lgfr	%r3,%r3			# int
 	llgfr	%r4,%r4			# unsigned long
 	jg	compat_sys_restore
-
-	.globl sys_clone_with_pids_wrapper
-sys_clone_with_pids_wrapper:
-	llgfr	%r2,%r2			# unsigned long
-	llgfr	%r3,%r3			# unsigned long
-	llgtr	%r4,%r4			# int *
-	llgtr	%r5,%r5			# int *
-	llgtr	%r6,%r6			# void *
-	llgtr	%r7,%r7			# void *
-	jg	compat_sys_clone_with_pids
-- 
1.6.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] s390: clone_with_pids: fix compat wrapper
       [not found] ` <20090622153052.GA32517-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
@ 2009-06-24 16:40   ` Oren Laadan
  0 siblings, 0 replies; 2+ messages in thread
From: Oren Laadan @ 2009-06-24 16:40 UTC (permalink / raw)
  To: Serge E. Hallyn; +Cc: Linux Containers, Martin Schwidefsky


Applied.

Oren.

Serge E. Hallyn wrote:
> Martin Schwidefsky pointed out two problems with my compat
> wrapper.  Define sys32_clone_with_pids() in compat_linux.c
> instead of using a syscall wrapper.
> 
> Signed-off-by: Serge E. Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> ---
>  arch/s390/kernel/compat_linux.c   |   19 +++++++++++++++++++
>  arch/s390/kernel/compat_wrapper.S |   10 ----------
>  2 files changed, 19 insertions(+), 10 deletions(-)
> 
> diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c
> index 002c70d..cb4a304 100644
> --- a/arch/s390/kernel/compat_linux.c
> +++ b/arch/s390/kernel/compat_linux.c
> @@ -821,6 +821,25 @@ asmlinkage long sys32_clone(void)
>  		       parent_tidptr, child_tidptr);
>  }
>  
> +asmlinkage long sys32_clone_with_pids(void)
> +{
> +	struct pt_regs *regs = task_pt_regs(current);
> +	unsigned long clone_flags;
> +	unsigned long newsp;
> +	int __user *parent_tidptr, *child_tidptr;
> +	void __user *upid_setp;
> +
> +	clone_flags = regs->gprs[3] & 0xffffffffUL;
> +	newsp = regs->orig_gpr2 & 0x7fffffffUL;
> +	parent_tidptr = compat_ptr(regs->gprs[4]);
> +	child_tidptr = compat_ptr(regs->gprs[5]);
> +	upid_setp = compat_ptr(regs->gprs[7]);
> +	if (!newsp)
> +		newsp = regs->gprs[15];
> +	return do_fork_with_pids(clone_flags, newsp, regs, 0,
> +		       parent_tidptr, child_tidptr, upid_setp);
> +}
> +
>  /*
>   * 31 bit emulation wrapper functions for sys_fadvise64/fadvise64_64.
>   * These need to rewrite the advise values for POSIX_FADV_{DONTNEED,NOREUSE}
> diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S
> index bf13315..c2228b2 100644
> --- a/arch/s390/kernel/compat_wrapper.S
> +++ b/arch/s390/kernel/compat_wrapper.S
> @@ -1837,13 +1837,3 @@ sys_restore_wrapper:
>  	lgfr	%r3,%r3			# int
>  	llgfr	%r4,%r4			# unsigned long
>  	jg	compat_sys_restore
> -
> -	.globl sys_clone_with_pids_wrapper
> -sys_clone_with_pids_wrapper:
> -	llgfr	%r2,%r2			# unsigned long
> -	llgfr	%r3,%r3			# unsigned long
> -	llgtr	%r4,%r4			# int *
> -	llgtr	%r5,%r5			# int *
> -	llgtr	%r6,%r6			# void *
> -	llgtr	%r7,%r7			# void *
> -	jg	compat_sys_clone_with_pids

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-06-24 16:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-22 15:30 [PATCH 1/1] s390: clone_with_pids: fix compat wrapper Serge E. Hallyn
     [not found] ` <20090622153052.GA32517-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-06-24 16:40   ` Oren Laadan

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.