From patchwork Wed May 14 17:17:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roland McGrath X-Patchwork-Id: 911 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx22.g.dreamhost.com (mx2.sub5.homie.mail.dreamhost.com [208.113.200.128]) by wilcox.dreamhost.com (Postfix) with ESMTP id BEC48360076 for ; Wed, 14 May 2014 10:18:02 -0700 (PDT) Received: by homiemail-mx22.g.dreamhost.com (Postfix, from userid 14307373) id 6A18158EEDB8; Wed, 14 May 2014 10:18:02 -0700 (PDT) X-Original-To: glibc@patchwork.siddhesh.in Delivered-To: x14307373@homiemail-mx22.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx22.g.dreamhost.com (Postfix) with ESMTPS id 37CF058EEDBE for ; Wed, 14 May 2014 10:18:02 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:content-type :content-transfer-encoding:from:to:subject:message-id:date; q= dns; s=default; b=K3UmnULg8SzCNFiaErRXWawqxhfvkUJHZtLqNoouokd3lB ov+ETKaDfhTU+QPGeOuWR1qVjNlA5jTYt2PAd5amrY4M3r6RKqFvzSz6HLIfYsPw QvuY2F+u8dA/iMq0AG1Sea1XA7jQD3yIXf6MgY+KSve9gmNN2F4vy5qAR3ZkE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:content-type :content-transfer-encoding:from:to:subject:message-id:date; s= default; bh=+ZKzU3v6HDjAAlYBU6vq3S2EKOM=; b=Kg+alILun2C+Ixg0EXAL zM5dJqMhlitC3TJ0Sc6P0s2/v3JYejFtbihF3bOS7j8+KcbeewTQpEl56iWIx2K7 NMH+C9MhQQ29DVWOCW6cmgahsZpzMMSsQdvjGU915aVsNk1jYvXxHXDbxM0O3mXO RBIgEUp0QnvOejal8zBQW9A= Received: (qmail 6519 invoked by alias); 14 May 2014 17:17:58 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 6446 invoked by uid 89); 14 May 2014 17:17:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: topped-with-meat.com MIME-Version: 1.0 From: Roland McGrath To: "GNU C. Library" Subject: [COMMITTED PATCH] x86: Consolidate NPTL/non versions of clone Message-Id: <20140514171755.284C92C39DB@topped-with-meat.com> Date: Wed, 14 May 2014 10:17:55 -0700 (PDT) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=HrjlRSjS c=1 sm=1 tr=0 a=WkljmVdYkabdwxfqvArNOQ==:117 a=14OXPxybAAAA:8 a=26W7Di2mX8EA:10 a=Z6MIti7PxpgA:10 a=kj9zAlcOel0A:10 a=hOe2yjtxAAAA:8 a=gu8FbsN5D2btMo6UH6cA:9 a=CjuIK1q_8ugA:10 X-DH-Original-To: glibc@patchwork.siddhesh.in Verified on x86_64-linux-gnu and i686-linux-gnu that no libc.so code changes. Thanks, Roland * sysdeps/unix/sysv/linux/x86_64/clone.S: Deconditionalize the code that was previously under [RESET_PID]. * sysdeps/unix/sysv/linux/i386/clone.S: Likewise. * nptl/sysdeps/unix/sysv/linux/x86_64/clone.S: File removed. * nptl/sysdeps/unix/sysv/linux/i386/clone.S: File removed. --- a/nptl/sysdeps/unix/sysv/linux/i386/clone.S +++ /dev/null @@ -1,9 +0,0 @@ -/* We want an #include_next, but we are the main source file. - So, #include ourselves and in that incarnation we can use #include_next. */ -#ifndef INCLUDED_SELF -# define INCLUDED_SELF -# include -#else -# define RESET_PID -# include_next -#endif --- a/nptl/sysdeps/unix/sysv/linux/x86_64/clone.S +++ /dev/null @@ -1,9 +0,0 @@ -/* We want an #include_next, but we are the main source file. - So, #include ourselves and in that incarnation we can use #include_next. */ -#ifndef INCLUDED_SELF -# define INCLUDED_SELF -# include -#else -# define RESET_PID -# include_next -#endif --- a/sysdeps/unix/sysv/linux/i386/clone.S +++ b/sysdeps/unix/sysv/linux/i386/clone.S @@ -74,9 +74,6 @@ ENTRY (__clone) movl %eax,8(%ecx) /* Don't leak any information. */ movl $0,4(%ecx) -#ifndef RESET_PID - movl $0,(%ecx) -#endif /* Do the system call */ pushl %ebx @@ -95,10 +92,8 @@ ENTRY (__clone) cfi_rel_offset (edi, 0) movl $SYS_ify(clone),%eax -#ifdef RESET_PID /* Remember the flag value. */ movl %ebx, (%ecx) -#endif /* End FDE now, because in the child the unwind info will be wrong. */ @@ -121,11 +116,9 @@ L(thread_start): cfi_undefined (eip); /* Note: %esi is zero. */ movl %esi,%ebp /* terminate the stack frame */ -#ifdef RESET_PID testl $CLONE_THREAD, %edi je L(newpid) L(haspid): -#endif call *%ebx #ifdef PIC call L(here) @@ -137,7 +130,6 @@ L(here): movl $SYS_ify(exit), %eax ENTER_KERNEL -#ifdef RESET_PID .subsection 2 L(newpid): testl $CLONE_VM, %edi @@ -150,7 +142,6 @@ L(nomoregetpid): movl %eax, %gs:TID jmp L(haspid) .previous -#endif cfi_endproc; cfi_startproc --- a/sysdeps/unix/sysv/linux/x86_64/clone.S +++ b/sysdeps/unix/sysv/linux/x86_64/clone.S @@ -92,7 +92,6 @@ L(thread_start): the outermost frame obviously. */ xorl %ebp, %ebp -#ifdef RESET_PID testq $CLONE_THREAD, %rdi jne 1f testq $CLONE_VM, %rdi @@ -103,7 +102,6 @@ L(thread_start): 2: movl %eax, %fs:PID movl %eax, %fs:TID 1: -#endif /* Set up arguments for the function call. */ popq %rax /* Function to call. */