From owner-svn-src-projects@freebsd.org Tue Sep 22 18:48:30 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 AE5BCA06B63 for ; Tue, 22 Sep 2015 18:48:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6F4BB1249; Tue, 22 Sep 2015 18:48:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [10.192.0.157] (unknown [178.20.49.58]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 170551AAE8; Tue, 22 Sep 2015 20:48:26 +0200 (CEST) Subject: Re: svn commit: r288121 - projects/clang370-import/contrib/libc++/src/support Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Content-Type: multipart/signed; boundary="Apple-Mail=_AF7745E6-E210-4AD1-9D18-9B0934AE5E04"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.5.1 From: Dimitry Andric In-Reply-To: <00F42FF7-84D4-4C97-974F-C28DB36D4392@bsdimp.com> Date: Tue, 22 Sep 2015 20:48:19 +0200 Cc: src-committers@freebsd.org, svn-src-projects@freebsd.org Message-Id: <9B0C3FE9-821B-470E-8AFC-F5B3DCE5B8F4@FreeBSD.org> References: <201509221734.t8MHYp0W052286@repo.freebsd.org> <00F42FF7-84D4-4C97-974F-C28DB36D4392@bsdimp.com> To: Warner Losh X-Mailer: Apple Mail (2.2104) 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 18:48:30 -0000 --Apple-Mail=_AF7745E6-E210-4AD1-9D18-9B0934AE5E04 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 On 22 Sep 2015, at 20:37, Warner Losh wrote: >=20 >> 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. >=20 > I don=E2=80=99t think you can do that. >=20 > arm < v6 is special. The CPUs don=E2=80=99t have atomic operations. In = the kernel, > we disable interrupts and do the op. You can=E2=80=99t 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=E2=80=99ll have some work to do this = properly. >=20 > I=E2=80=99m not entirely sure that your =E2=80=98fix=E2=80=99 makes = things actually safe, even if it > seems to make them work today. I=E2=80=99ll have to study it more = closely. Probably not 100% safe, since the stub functions are just placeholders which aren't atomic at all. 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 --Apple-Mail=_AF7745E6-E210-4AD1-9D18-9B0934AE5E04 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.28 iEUEARECAAYFAlYBongACgkQsF6jCi4glqMJUQCbB7LhBo2PI6aBtZhfknXwfHBy PEEAlisU20NCVBdV9c2JGqrEWmOFpDM= =0OIg -----END PGP SIGNATURE----- --Apple-Mail=_AF7745E6-E210-4AD1-9D18-9B0934AE5E04--