From mboxrd@z Thu Jan 1 00:00:00 1970 From: Will Deacon Subject: Re: [PATCH 18/18] arm64: lto: Strengthen READ_ONCE() to acquire when CLANG_LTO=y Date: Mon, 6 Jul 2020 19:35:11 +0100 Message-ID: <20200706183510.GA23766@willie-the-truck> References: <20200630173734.14057-1-will@kernel.org> <20200630173734.14057-19-will@kernel.org> <20200706160820.GC10992@arm.com> Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594060518; bh=L1CbjDcZbuTi+ztU4KBMPGZHPbJI+hhe3kCcYygI0o0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pihAVQPmOe+iFKvXzWEZmccOMAFXbtPUIoeXKLuLZyeXrYbyOJ6cXySu9bEogjbdh cLDn9jzGmTenZvCFTagNnHqffzlsPGhOGmvjuOt5phD9ZUcu+P3pwzmspR82n/YyNp ck5o8VKYVnNWweouqlXuNVXDuMhuL9ES7pvNRgzU= Content-Disposition: inline In-Reply-To: <20200706160820.GC10992@arm.com> Sender: linux-alpha-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Dave Martin Cc: linux-kernel@vger.kernel.org, Mark Rutland , "Michael S. Tsirkin" , Peter Zijlstra , Catalin Marinas , Jason Wang , virtualization@lists.linux-foundation.org, Arnd Bergmann , Alan Stern , Sami Tolvanen , Matt Turner , kernel-team@android.com, Marco Elver , Kees Cook , "Paul E. McKenney" , Boqun Feng , Josh Triplett , Ivan Kokshaysky , linux-arm-kernel@lists.infradead.org, Richard Henderson , Nick On Mon, Jul 06, 2020 at 05:08:20PM +0100, Dave Martin wrote: > On Tue, Jun 30, 2020 at 06:37:34PM +0100, Will Deacon wrote: > > diff --git a/arch/arm64/include/asm/rwonce.h b/arch/arm64/include/asm/rwonce.h > > new file mode 100644 > > index 000000000000..515e360b01a1 > > --- /dev/null > > +++ b/arch/arm64/include/asm/rwonce.h > > @@ -0,0 +1,63 @@ > > +/* SPDX-License-Identifier: GPL-2.0 */ > > +/* > > + * Copyright (C) 2020 Google LLC. > > + */ > > +#ifndef __ASM_RWONCE_H > > +#define __ASM_RWONCE_H > > + > > +#ifdef CONFIG_CLANG_LTO > > + > > +#include > > +#include > > + > > +#ifndef BUILD_VDSO > > + > > +#ifdef CONFIG_AS_HAS_LDAPR > > +#define __LOAD_RCPC(sfx, regs...) \ > > + ALTERNATIVE( \ > > + "ldar" #sfx "\t" #regs, \ > > ^ Should this be here? It seems that READ_ONCE() will actually read > twice... even if that doesn't actually conflict with the required > semantics of READ_ONCE(), it looks odd. It's patched at runtime, so it's either LDAR or LDAPR. > Making a direct link between LTO and the memory model also seems highly > spurious (as discussed in the other subthread) so can we have a comment > explaining the reasoning? Sure, although like I say, this is more about helping to progress that conversation. Will