[RFC][PATCH] clone_with_pids()^w eclone() for x86_64

Louis Rilling Louis.Rilling at kerlabs.com
Fri Nov 20 05:51:06 PST 2009


On 19/11/09 22:44 +0100, Louis Rilling wrote:
> On Thu, Nov 19, 2009 at 01:32:36PM -0800, Dave Hansen wrote:
> > On Thu, 2009-11-19 at 22:26 +0100, Louis Rilling wrote:
> > > But actually this is even better :D:
> > > 
> > >          __asm__  __volatile__(
> > >                   "movq %3, %%r10\n\t"           /* pids in r10*/
> > >                   "pushq %%rbp\n\t"              /* save value of ebp */
> > >                  :
> > >                  :"D" (flags_low), /* rdi */
> > >                   "S" (clone_args),/* rsi */
> > >                   "d" (args_size), /* rdx */
> > >                   "r10" (pids)     /* Linux reads its fourth arg from r10 */
> > >                  );
> > 
> > That gives me:
> > 
> > clone-lib.c:28: error: matching constraint references invalid operand
> > number
> 
> ?? I know that this syntax works for r8, but I don't remember for r9-r15. I don't
> have my handy documentation nearby, so let met check tomorrow (if nobody finds
> before).

Ok, I couldn't even find why r8 works, but according to this
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16331
gcc support for using those registers in inline asm constraints is deliberately
missing.

So the only safe solution is something like your first one, although we could
expect that using rcx instead of rax will optimize it a bit.

Thanks,

Louis

-- 
Dr Louis Rilling			Kerlabs
Skype: louis.rilling			Batiment Germanium
Phone: (+33|0) 6 80 89 08 23		80 avenue des Buttes de Coesmes
http://www.kerlabs.com/			35700 Rennes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://lists.linux-foundation.org/pipermail/containers/attachments/20091120/f848b881/attachment.pgp 


More information about the Containers mailing list