From owner-svn-src-projects@freebsd.org Tue Sep 22 19:14:09 2015 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69CA0A0771C for ; Tue, 22 Sep 2015 19:14:09 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F8DE145A for ; Tue, 22 Sep 2015 19:14:08 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound1.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Tue, 22 Sep 2015 19:14:39 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t8MJE5Hd001612; Tue, 22 Sep 2015 13:14:05 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1442949245.1224.229.camel@freebsd.org> Subject: Re: svn commit: r288121 - projects/clang370-import/contrib/libc++/src/support From: Ian Lepore To: Dimitry Andric Cc: Warner Losh , src-committers@freebsd.org, svn-src-projects@freebsd.org Date: Tue, 22 Sep 2015 13:14:05 -0600 In-Reply-To: <9B0C3FE9-821B-470E-8AFC-F5B3DCE5B8F4@FreeBSD.org> References: <201509221734.t8MHYp0W052286@repo.freebsd.org> <00F42FF7-84D4-4C97-974F-C28DB36D4392@bsdimp.com> <9B0C3FE9-821B-470E-8AFC-F5B3DCE5B8F4@FreeBSD.org> Content-Type: text/plain; charset="iso-8859-7" X-Mailer: Evolution 3.12.10 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2015 19:14:09 -0000 On Tue, 2015-09-22 at 20:48 +0200, Dimitry Andric wrote: > On 22 Sep 2015, at 20:37, Warner Losh wrote: > > > >> On Sep 22, 2015, at 11:34 AM, Dimitry Andric wrote: > >> NOTE: this needs to be fixed properly later on, by supplying library > >> functions implementing atomic operations for arm < v6. We should > >> probably take those from sys/arm/arm/stdatomic.c, and stuff them into > >> either libgcc or compiler-rt. > > > > I don¢t think you can do that. > > > > arm < v6 is special. The CPUs don¢t have atomic operations. In the kernel, > > we disable interrupts and do the op. You can¢t do that in user land. Instead, > > you have to use RAS (Restartable Atomic Sequences) and have the kernel > > grok the RAS. Thankfully, the RAS support in the kernel is just the R in that. > > But it does mean that we¢ll have some work to do this properly. > > > > I¢m not entirely sure that your ¡fix¢ makes things actually safe, even if it > > seems to make them work today. I¢ll have to study it more closely. > > Probably not 100% safe, since the stub functions are just placeholders > which aren't atomic at all. This is confusing. The fact that these are stubs and aren't atomic at all is the problem. There's no reason not to have real implementations on arm < v6, machine/atomic.h has all the common stuff implemented already. -- Ian > Then again, if we insist on this being > correct, we will have no choice as to disable the atomic support in > libc++ somehow. (I'm not sure if this is supported by upstream at all.) > > As far as I understood on IRC, the functions in stdatomic.c should work > in userland, unless you are using real SMP? (And does that even exist > for such old ARM architectures?) > > -Dimitry >