[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+icZUUrsG-Y_3Rg3a6+5mXXoh_w=QYnCFAazKane9fwXAWynw@mail.gmail.com>
Date: Tue, 25 Aug 2020 17:21:52 +0200
From: Sedat Dilek <sedat.dilek@...il.com>
To: Arvind Sankar <nivedita@...m.mit.edu>
Cc: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Segher Boessenkool <segher@...nel.crashing.org>,
Thomas Gleixner <tglx@...utronix.de>,
Nick Desaulniers <ndesaulniers@...gle.com>,
"Paul E. McKenney" <paulmck@...nel.org>,
Ingo Molnar <mingo@...hat.com>, Arnd Bergmann <arnd@...db.de>,
Borislav Petkov <bp@...en8.de>,
"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@...nel.org>,
"H. Peter Anvin" <hpa@...or.com>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Kees Cook <keescook@...omium.org>,
Peter Zijlstra <peterz@...radead.org>,
Juergen Gross <jgross@...e.com>,
Andy Lutomirski <luto@...nel.org>,
Andrew Cooper <andrew.cooper3@...rix.com>,
LKML <linux-kernel@...r.kernel.org>,
clang-built-linux <clang-built-linux@...glegroups.com>,
Will Deacon <will@...nel.org>
Subject: Re: [PATCH] x86/asm: Replace __force_order with memory clobber
On Tue, Aug 25, 2020 at 5:19 PM Arvind Sankar <nivedita@...m.mit.edu> wrote:
>
> On Mon, Aug 24, 2020 at 09:13:34PM +0200, Miguel Ojeda wrote:
> > Hi Arvind,
> >
> > On Sun, Aug 23, 2020 at 11:25 PM Arvind Sankar <nivedita@...m.mit.edu> wrote:
> > >
> > > - Using a dummy input operand with an arbitrary constant address for the
> > > read functions, instead of a global variable. This will prevent reads
> > > from being reordered across writes, while allowing memory loads to be
> > > cached/reordered across CRn reads, which should be safe.
> >
> > Assuming no surprises from compilers, this looks better than dealing
> > with different code for each compiler.
> >
> > > Signed-off-by: Arvind Sankar <nivedita@...m.mit.edu>
> > > Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82602
> >
> > A lore link to the other discussion would be nice here for context.
> >
>
> Ok.
>
> > > + * The compiler should not reorder volatile asm, however older versions of GCC
> > > + * had a bug (which was fixed in 8.1, 7.3 and 6.5) where they could sometimes
> >
> > I'd mention the state of GCC 5 here.
> >
>
> Ok.
>
> > > + * reorder volatile asm. The write functions are not a problem since they have
> > > + * memory clobbers preventing reordering. To prevent reads from being reordered
> > > + * with respect to writes, use a dummy memory operand.
> > > */
> > > -extern unsigned long __force_order;
> > > +
> >
> > Spurious newline?
> >
>
> This was intentional, but I can remove it if people don't like the extra
> whitespace.
>
> I'll wait a few days for additional review comments before sending v2.
>
> Thanks.
Thanks for taking care and your patch.
I have tested this on top of Linux v5.9-rc2 with LLVM toolchain
v11.0.0-rc2 (ThinLTO).
Tested-by: Sedat Dilek <sedat.dilek@...il.com>
- Sedat -
Powered by blists - more mailing lists