From patchwork Fri Apr 22 19:40:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Schwab X-Patchwork-Id: 11861 Received: (qmail 3575 invoked by alias); 22 Apr 2016 19:40:37 -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 3549 invoked by uid 89); 22 Apr 2016 19:40:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=9910, 8276 X-HELO: mail-out.m-online.net X-Auth-Info: QdHgZ9D2Ok6z4zm68ciq53O1iAsxHQunFUrd2YgiF0FP7gaXMcCazYFj5aSpBpX2 From: Andreas Schwab To: Adhemerval Zanella Cc: libc-alpha@sourceware.org Subject: Re: [PATCH v3] Fix clone (CLONE_VM) pid/tid reset (BZ#19957) References: <1461351245-22814-1-git-send-email-adhemerval.zanella@linaro.org> X-Yow: Yow! Is this sexual intercourse yet?? Is it, huh, is it?? Date: Fri, 22 Apr 2016 21:40:21 +0200 In-Reply-To: <1461351245-22814-1-git-send-email-adhemerval.zanella@linaro.org> (Adhemerval Zanella's message of "Fri, 22 Apr 2016 15:54:05 -0300") Message-ID: <87eg9x77q2.fsf@linux-m68k.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.92 (gnu/linux) MIME-Version: 1.0 Adhemerval Zanella writes: > diff --git a/sysdeps/unix/sysv/linux/m68k/clone.S b/sysdeps/unix/sysv/linux/m68k/clone.S > index 33474cc..84eb2b9 100644 > --- a/sysdeps/unix/sysv/linux/m68k/clone.S > +++ b/sysdeps/unix/sysv/linux/m68k/clone.S > @@ -25,7 +25,6 @@ > #include > > #define CLONE_VM 0x00000100 > -#define CLONE_THREAD 0x00010000 > > /* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg, > void *parent_tidptr, void *tls, void *child_tidptr) */ > @@ -101,12 +100,9 @@ thread_start: > subl %fp, %fp /* terminate the stack frame */ > /* Check and see if we need to reset the PID. */ > movel %d1, %a1 > - andl #CLONE_THREAD, %d1 > + andl #CLONE_VM, %d1 > jne donepid > movel %a1, %d1 > - movel #-1, %d0 > - andl #CLONE_VM, %d1 > - jne gotpid > movel #SYS_ify (getpid), %d0 > trap #0 > gotpid: This can be simplified further: Andreas. diff --git a/sysdeps/unix/sysv/linux/m68k/clone.S b/sysdeps/unix/sysv/linux/m68k/clone.S index 33474cc..aec12cb 100644 --- a/sysdeps/unix/sysv/linux/m68k/clone.S +++ b/sysdeps/unix/sysv/linux/m68k/clone.S @@ -25,7 +25,6 @@ #include #define CLONE_VM 0x00000100 -#define CLONE_THREAD 0x00010000 /* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg, void *parent_tidptr, void *tls, void *child_tidptr) */ @@ -100,16 +99,10 @@ thread_start: cfi_undefined (pc) /* Mark end of stack */ subl %fp, %fp /* terminate the stack frame */ /* Check and see if we need to reset the PID. */ - movel %d1, %a1 - andl #CLONE_THREAD, %d1 - jne donepid - movel %a1, %d1 - movel #-1, %d0 andl #CLONE_VM, %d1 - jne gotpid + jne donepid movel #SYS_ify (getpid), %d0 trap #0 -gotpid: movel %a0, -(%sp) movel %d0, -(%sp) bsrl __m68k_read_tp@PLTPC