From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25800 invoked by alias); 22 Apr 2016 19:57:28 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 25783 invoked by uid 89); 22 Apr 2016 19:57:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=9910, 22042016 X-HELO: mail-yw0-f170.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=44o83DVyFXmutM/jcYgkZ5mATE+0WFNcJpH9YVW441E=; b=SRrGPPhGXKISZVbKnSBA23M+GKUcnGUjDuy8nWN7SlyXAl1MAiVoV5FYhrQHaMbfma ET/xZNGmPv7ziUMuKQV5v1rxrQ28y39rNoLD0YsYyf2J2MHbU8y7p42DipfIAtPvHRoU afht5m5dmxsLSKZ05WElckgk+NGDksbzy8H9bAWdSPWOBsE7p8ykYXsjT1HqBnI4hsSW tHNcy7+zE/IX0mzRzC8kpy3GT4+L7E+jyfq5cmWPqAeLCzcgAlw4mkxu+vtATo7KPITN uBd33OXUeh/0Pb3mXbcMa6QG06Dl+3O48yePpxlMdQ687wAiNvbmOhgJWUJ/6cbB1XJ6 VHtw== X-Gm-Message-State: AOPr4FWH645sLkhc5OvbA++8BIVfZf7YebHRRuZ2jrZ1uQHXsmAgmzeqYmNAm72KFYsK+u3e X-Received: by 10.129.155.198 with SMTP id s189mr9399404ywg.31.1461355041992; Fri, 22 Apr 2016 12:57:21 -0700 (PDT) Subject: Re: [PATCH v3] Fix clone (CLONE_VM) pid/tid reset (BZ#19957) To: Andreas Schwab References: <1461351245-22814-1-git-send-email-adhemerval.zanella@linaro.org> <87eg9x77q2.fsf@linux-m68k.org> Cc: libc-alpha@sourceware.org From: Adhemerval Zanella Message-ID: <571A821D.5000607@linaro.org> Date: Fri, 22 Apr 2016 19:57:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <87eg9x77q2.fsf@linux-m68k.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-04/txt/msg00570.txt.bz2 On 22-04-2016 16:40, Andreas Schwab wrote: > 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: > > 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 > > > Andreas. > Thanks, I use this simplification.