From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [RFC][v7][PATCH 8/9]: Define clone2() syscall Date: Wed, 30 Sep 2009 19:59:40 +0200 Message-ID: <200909301959.41706.arnd@arndb.de> References: <20090924165548.GA16586@us.ibm.com> <200909301815.45211.arnd@arndb.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Linus Torvalds Cc: Pavel Emelyanov , linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Containers , Nathan Lynch , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, "Eric W. Biederman" , kosaki.motohiro-+CUm20s59erQFUHtdCDX3A@public.gmane.org, "H. Peter Anvin" , mingo-X9Un+BFzKDI@public.gmane.org, Sukadev Bhattiprolu , Alexey Dobriyan , Roland McGrath , Arjan van de Ven List-Id: containers.vger.kernel.org On Wednesday 30 September 2009, Linus Torvalds wrote: > Umm. I don't think that is possible. > > You need architecture-specific code to even get access to all registers to > copy and get a signal-handler-compatible stack frame. See for example > arch/alpha/kernel/entry.S with the switch-stack thing etc. I don't think > there is any way to make that even remotely architecture-neutral. Right, you still need to save all the registers from the entry code. I was under the wrong assumption that task_pt_regs(current) would give the full register set on all architectures. However, I'd still hope that a new system call can be defined in a way that you only need to have an assembly wrapper to save the full pt_regs, but no arch specific code to get the syscall arguments out of that again. In do_clone(), you need a pointer to pt_regs and the user stack pointer, but that can be generated from user_stack_pointer(regs). Does task_pt_regs(current) give the right pointer on all architectures or do we also need to pass the regs into the syscall? Arnd <><