[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200813180933.GA532283@rani.riverdale.lan>
Date: Thu, 13 Aug 2020 14:09:33 -0400
From: Arvind Sankar <nivedita@...m.mit.edu>
To: "Paul E. McKenney" <paulmck@...nel.org>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Nick Desaulniers <ndesaulniers@...gle.com>,
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>,
Zhenzhong Duan <zhenzhong.duan@...cle.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>,
Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH] x86: work around clang IAS bug referencing __force_order
On Thu, Aug 13, 2020 at 10:37:01AM -0700, Paul E. McKenney wrote:
> On Thu, Aug 13, 2020 at 07:28:57PM +0200, Thomas Gleixner wrote:
> > Nick Desaulniers <ndesaulniers@...gle.com> writes:
> > > On Thu, Aug 6, 2020 at 3:11 PM Thomas Gleixner <tglx@...utronix.de> wrote:
> > >> > + *
> > >> > + * Clang sometimes fails to kill the reference to the dummy variable, so
> > >> > + * provide an actual copy.
> > >>
> > >> Can that compiler be fixed instead?
> > >
> > > I don't think so. The logic in the compiler whether to emit an
> >
> > Forget that I asked. Heat induced brain damaged.
> >
> > > I'd much rather remove all of __force_order.
> >
> > Right.
> >
> > > Not sure about the comment in arch/x86/include/asm/special_insns.h
> > > either; smells fishy like a bug with a compiler from a long time ago.
> > > It looks like it was introduced in:
> > > commit d3ca901f94b32 ("x86: unify paravirt parts of system.h")
> > > Lore has this thread:
> > > https://lore.kernel.org/lkml/4755A809.4050305@qumranet.com/
> > > Patch 4: https://lore.kernel.org/lkml/11967844071346-git-send-email-gcosta@redhat.com/
> > > It seems like there was a discussion about %cr8, but no one asked
> > > "what's going on here with __force_order, is that right?"
> >
> > Correct and the changelog is uselss in this regard.
> >
> > > Quick boot test of the below works for me, though I should probably
> > > test hosting a virtualized guest since d3ca901f94b32 refers to
> > > paravirt. Thoughts?
> >
> > Let me ask (hopefully) useful questions this time:
> >
> > Is a compiler allowed to reorder two 'asm volatile()'?
> >
> > Are there compilers (gcc >= 4.9 or other supported ones) which do that?
>
> I would hope that the answer to both of these questions is "no"!
>
> But I freely confess that I have been disappointed before on this sort
> of thing. :-/
>
> Thanx, Paul
Ok, I found this, so gcc developers consider re-ordering volatile asm
wrt each other a bug at least.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82602
Powered by blists - more mailing lists