[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrVeOKXa_xiggzqjcx34TtTs_rMyq56u-EXCFYgQtcei5g@mail.gmail.com>
Date: Wed, 14 Feb 2018 17:21:55 +0000
From: Andy Lutomirski <luto@...capital.net>
To: James Y Knight <jyknight@...gle.com>
Cc: "Yatsina, Marina" <marina.yatsina@...el.com>,
Kees Cook <keescook@...gle.com>,
David Woodhouse <dwmw2@...radead.org>,
Chandler Carruth <chandlerc@...gle.com>,
"Kreitzer, David L" <david.l.kreitzer@...el.com>,
"Grischenko, Andrei L" <andrei.l.grischenko@...el.com>,
"rnk@...gle.com" <rnk@...gle.com>,
LLVM Developers <llvm-dev@...ts.llvm.org>,
"ehsan@...illa.com" <ehsan@...illa.com>,
"Tayree, Coby" <coby.tayree@...el.com>,
Matthias Braun <matze@...unis.de>,
Dean Michael Berris <dean.berris@...il.com>,
Guenter Roeck <linux@...ck-us.net>, X86 ML <x86@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
Alan Cox <gnomes@...rguk.ukuu.org.uk>,
Rik van Riel <riel@...hat.com>,
Andi Kleen <ak@...ux.intel.com>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Tom Lendacky <thomas.lendacky@....com>,
Peter Zijlstra <peterz@...radead.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Jiri Kosina <jikos@...nel.org>,
"Hansen, Dave" <dave.hansen@...el.com>,
Tim Chen <tim.c.chen@...ux.intel.com>,
Greg Kroah-Hartman <gregkh@...ux-foundation.org>,
Paul Turner <pjt@...gle.com>,
Stephen Hines <srhines@...gle.com>,
Nick Desaulniers <ndesaulniers@...gle.com>
Subject: Re: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add
clang support)
On Wed, Feb 14, 2018 at 3:31 PM, James Y Knight <jyknight@...gle.com> wrote:
> I'd be definitely in favor having clang support asm goto. I wouldn't
> want to exclude having other conversations about how to more directly
> provide compiler features that the linux kernel could use, ALSO, but I
> do not think that conversation should block implementing asm-goto.
>
> IMO, inline asm is, generally, a valuable feature to provide in the
> compiler as an escape hatch, and asm goto is a relatively sane
> extension of it. Supporting outgoing edges from an inline asm block is
> a reasonable thing for users to desire, and as far as anyone's said so
> far, seems like it ought to be fairly easily implementable, without
> causing bad side-effects in the compiler.
>
> Of course, we generally do want to minimize the need for users to use
> inline asm, by providing appropriate compiler support for the features
> people would otherwise be forced to implement using asm. But I don't
> see that as really any more important for asm-goto than any other
> inline asm. There will always be a desire for escape hatches, to do
> weird and unique things which aren't supported directly in the
> compiler. (Also, the kernel is a pretty special case in terms of its
> requirements, it seems exceedingly unlikely that we could ever provide
> enough compiler support to let it eliminate inline asm.).
>
If clang implements asm goto, could you also pretty please make it
better than GCC and support output constraints in the same asm
statements? This would give us a very clean, short, and fast
implementation for __get_user() and __put_user(), and it would also
help put pressure on GCC to implement the same feature.
Powered by blists - more mailing lists