From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Borntraeger Subject: Re: [PATCH 01/13] compiler.h: Split {READ,WRITE}_ONCE definitions out into rwonce.h Date: Mon, 11 Nov 2019 09:10:00 +0100 Message-ID: <93f80017-d65e-7c3a-29b0-d9a568d08f58@de.ibm.com> References: <20191108170120.22331-1-will@kernel.org> <20191108170120.22331-2-will@kernel.org> Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="iso-8859-1" To: Arnd Bergmann , Will Deacon Cc: "linux-kernel@vger.kernel.org" , Yunjae Lee , SeongJae Park , "Paul E. McKenney" , Josh Triplett , Matt Turner , Ivan Kokshaysky , Richard Henderson , Peter Zijlstra , Alan Stern , Michael Ellerman , "Michael S. Tsirkin" , Jason Wang , Joe Perches , Boqun Feng , alpha , virtualization@lists.linux-foundation.org On 08.11.19 20:57, Arnd Bergmann wrote: > On Fri, Nov 8, 2019 at 6:01 PM Will Deacon wrote: >> >> In preparation for allowing architectures to define their own >> implementation of the 'READ_ONCE()' macro, move the generic >> '{READ,WRITE}_ONCE()' definitions out of the unwieldy 'linux/compiler.h' >> and into a new 'rwonce.h' header under 'asm-generic'. >=20 > Adding Christian Borntr=C3=A4ger to Cc, he originally added the > READ_ONCE()/WRITE_ONCE() > code. >=20 > I wonder if it would be appropriate now to revert back to a much simpler = version > of these helpers for any modern compiler. As I understand, only gcc-4.6 a= nd > gcc4.7 actually need the song-and-dance version with the union and switch= /case, > while for others, we can might be able back to a macro doing a volatile a= ccess. As far as I know this particular issue with volatile access on aggregate t= ypes was fixed in gcc 4.8. On the other hand we know that the current construct = will work on all compilers. Not so sure about the orignal ACCESS_ONCE implementa= tion.