From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 16148 invoked from network); 22 Dec 2020 00:00:27 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 22 Dec 2020 00:00:27 -0000 Received: (qmail 5436 invoked by uid 550); 22 Dec 2020 00:00:24 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 5413 invoked from network); 22 Dec 2020 00:00:24 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NWeojrDrr+liYM19HLutkeOtAsZDgR1Q/ppGN8Rajig=; b=Wd/wCdt/U9vWPEdvzbutUNjpdrAO35TetyXDSPrxsIpi2paDRKJhfQ+kdFo1TFfPhH 4mGrD5R/fDy5GAqPW3IXqwh+eIfV/jcbKNBnxBBm0D3rMwssEZD5POhEgprnh/WfR+xd SM4XuHxxglsJ8O2qidmLPOGjjT4Pjlb/gbp7/n67HP7qqvK033fI6UVZIYSS/0wWUKav XiWGbZ/d3MahWnpTJigE02bMIb6g5ZIyLpJcrtghKnBgSh45Qy9kOgIhq0venOWFlLAq 5XOgfv4CFiH0Ql2l1ZOeSE9MocNKI24E7hy8CaHDJ6ykO0yTzVtYzrh0URCDePJtoXoU DZNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NWeojrDrr+liYM19HLutkeOtAsZDgR1Q/ppGN8Rajig=; b=ChZrqkpqdGmf86L158K8mNM0xzvIcwOm2s04IHze/ria0smNqKl6iFAc0r/hLSWWp6 uGVu21/1dt97YWELqIAlLZtkhGn+mrV1r5rvDs6crpi6uHKEwnv9RmHzosL5Lym/7h7S +xSh9nDbq6df9j+CHTrBhBfqqhVXB7mF76zkLTGNZkZwRES5NuynXnLTzxgqPgruNwi3 ADHkzT06Yab5TPh4eH4/3iTspOKqoohWxt62uhKTNnfk1+OVAJCKRbaBWV2h3MfD3zH2 eRk4ydOrqSW3NFbvzAXq4lf/BTuxt+DVIv7j6Y/e7bHVG8j3Hc5NR5Qr51kDP6VW4ULs u3Ng== X-Gm-Message-State: AOAM532mBs/JQ6dp4vzxz3nkjGkbD9kbPkMgdQIFiOxkv91uIpogTqeX FYcYU6W07Owt0J6c1quA7oRB8OB9McFwjPOBq0IeVc9DyeA= X-Google-Smtp-Source: ABdhPJyQkhKonIGwgHv/WondyD5B5gglxdqAfx1zq3CJD5cSJvx6WunK1kXbZdvvS8Yx978AIWir7wW8gVRILt/kXKk= X-Received: by 2002:a05:6638:2a5:: with SMTP id d5mr16710839jaq.92.1608595211585; Mon, 21 Dec 2020 16:00:11 -0800 (PST) MIME-Version: 1.0 References: <20201217002348.GO534@brightrain.aerifal.cx> <20201218193849.GA7530@voyager> <20201218203444.GS534@brightrain.aerifal.cx> In-Reply-To: <20201218203444.GS534@brightrain.aerifal.cx> From: Jesse DeGuire Date: Mon, 21 Dec 2020 19:00:02 -0500 Message-ID: To: musl@lists.openwall.com Cc: Markus Wichmann Content-Type: text/plain; charset="UTF-8" Subject: Re: [musl] Musl on Cortex-M Devices On Fri, Dec 18, 2020 at 3:35 PM Rich Felker wrote: > > On Fri, Dec 18, 2020 at 08:38:49PM +0100, Markus Wichmann wrote: > > On Wed, Dec 16, 2020 at 07:23:49PM -0500, Rich Felker wrote: > > > On Wed, Dec 16, 2020 at 06:43:15PM -0500, Jesse DeGuire wrote: > > > > diff --git a/src/thread/arm/__unmapself.s b/src/thread/arm/__unmapself..s > > > > index 29c2d07b..fe0406e3 100644 > > > > --- a/src/thread/arm/__unmapself.s > > > > +++ b/src/thread/arm/__unmapself.s > > > > @@ -3,7 +3,7 @@ > > > > .global __unmapself > > > > .type __unmapself,%function > > > > __unmapself: > > > > - mov r7,#91 > > > > + movs r7,#91 > > > > svc 0 > > > > - mov r7,#1 > > > > + movs r7,#1 > > > > svc 0 > > > > > > OK, but this file can't be used on nommu anyway. Instead the generic C > > > version has to be used. > > > > > > > Speaking of that (C) version, maybe someone should note down somewhere > > that it is only safe to call if simultaneous calls from other threads > > are precluded somehow. That function uses global variables, so if > > multiple threads call it at the same time, there will be blood (well, > > there will be clobbering in any case). Which is fulfilled at the moment: > > The only call site of __unmapself() is pthread_exit(), after getting the > > thread list lock. That is a global lock, so further threads also > > exitting would have to queue up there. But I think it is rather > > non-intuitive that the thread-list lock happens to also protect the > > global variables in __unmapself.c. And that is a property of the C > > version not shared by the assembler versions, which are all thread-safe. > > Prior to commit 8f11e6127fe93093f81a52b15bb1537edc3fc8af, > __unmapself.c had its own lock and had to explicitly modify the exit > futex address to unlock that lock. Now it can (and must, since neither > can be unlocked before the kernel-level task exits) share the thread > list lock for this purpose. > > FWIW there's arguably no reason to even keep the asm versions of this > function now that the thread list lock exists. We could just remove > them all. Should I just go ahead and remove this so the generic C version is used instead since I'm already here? -Jesse