Re: [RFC][v6][PATCH 8/9]: Define clone_with_pids() syscall

From: Arnd Bergmann
Date: Fri Sep 11 2009 - 07:13:19 EST


On Friday 11 September 2009, Louis Rilling wrote:
> On 11/09/09 12:31 +0200, Arnd Bergmann wrote:
> > On Thursday 10 September 2009, Sukadev Bhattiprolu wrote:
> > > Since this is a variant of clone() and clone is listed as a PTREGSCALL(),
> > > I pass in the pt_regs.
> > >
> > > arch/x86/kernel/entry_32.S lists clone() under this comment:
> > >
> > > /*
> > > * System calls that need a pt_regs pointer.
> > > */
> > >
> > > Is there a guideline on what system calls use/need pt_regs ?
> >
> > You need pt_regs if you access any registers from the user task
> > other than the argument registers. In case of clone(), this is
> > the user stack pointer.
>
> AFAICS clone() actually needs all registers (see x86 copy_thread() for
> instance). Any variant of clone() will have this requirement.

Right, but that part (do_fork) is already handled in common code, which
function calls into architecture specific code.

The point I was making is that the sys_clone() and sys_clone_with_pids()
functions themselves only access the argument registers, the stack
pointer and pass those down to do_fork, along with pt_regs.

Arnd <><
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/