Re: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add clang support)

2018-02-14 Thread Ingo Molnar
* Ingo Molnar wrote: > To quantify it: I just performed a test build of a Linux distro kernel config > (Fedora x86-64), and counted the number of callsites that use 'asm goto' > functionality with the v4.15 kernel (including drivers). > > The results: > >

Re: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add clang support)

2018-02-14 Thread Ingo Molnar
* Ingo Molnar wrote: > To quantify it: I just performed a test build of a Linux distro kernel config > (Fedora x86-64), and counted the number of callsites that use 'asm goto' > functionality with the v4.15 kernel (including drivers). > > The results: > >

Re: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add clang support)

2018-02-14 Thread Peter Zijlstra
On Wed, Feb 14, 2018 at 09:31:22AM -0800, Kees Cook wrote: > On Wed, Feb 14, 2018 at 1:08 AM, Peter Zijlstra wrote: > > If you ever get to the point where it makes sense to build a kernel with > > LLVM [...] > > Just to speak to this point in particular: it makes sense to

Re: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add clang support)

2018-02-14 Thread Peter Zijlstra
On Wed, Feb 14, 2018 at 09:31:22AM -0800, Kees Cook wrote: > On Wed, Feb 14, 2018 at 1:08 AM, Peter Zijlstra wrote: > > If you ever get to the point where it makes sense to build a kernel with > > LLVM [...] > > Just to speak to this point in particular: it makes sense to build > kernels with

Re: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add clang support)

2018-02-14 Thread Linus Torvalds
On Wed, Feb 14, 2018 at 7:31 AM, James Y Knight wrote: > > 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. Side note: one thing that limits "asm goto" in gcc is the fact

Re: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add clang support)

2018-02-14 Thread Linus Torvalds
On Wed, Feb 14, 2018 at 7:31 AM, James Y Knight wrote: > > 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. Side note: one thing that limits "asm goto" in gcc is the fact that you can't have

Re: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add clang support)

2018-02-14 Thread Linus Torvalds
On Wed, Feb 14, 2018 at 2:34 AM, Peter Zijlstra wrote: > > So it's far more than just tracepoints. We use it all over the kernel to > do runtime branch patching. Side note: I have a patch to the user access code to do "asm goto" for the exception handling too. In fact, the

Re: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add clang support)

2018-02-14 Thread Linus Torvalds
On Wed, Feb 14, 2018 at 2:34 AM, Peter Zijlstra wrote: > > So it's far more than just tracepoints. We use it all over the kernel to > do runtime branch patching. Side note: I have a patch to the user access code to do "asm goto" for the exception handling too. In fact, the infrastructure is

Re: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add clang support)

2018-02-14 Thread Kees Cook
On Wed, Feb 14, 2018 at 1:08 AM, Peter Zijlstra wrote: > If you ever get to the point where it makes sense to build a kernel with > LLVM [...] Just to speak to this point in particular: it makes sense to build kernels with LLVM right now. It's already happened; millions of

Re: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add clang support)

2018-02-14 Thread Kees Cook
On Wed, Feb 14, 2018 at 1:08 AM, Peter Zijlstra wrote: > If you ever get to the point where it makes sense to build a kernel with > LLVM [...] Just to speak to this point in particular: it makes sense to build kernels with LLVM right now. It's already happened; millions of Pixel 2 phones are

Re: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add clang support)

2018-02-14 Thread Andy Lutomirski
On Wed, Feb 14, 2018 at 3:31 PM, James Y Knight 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

Re: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add clang support)

2018-02-14 Thread Andy Lutomirski
On Wed, Feb 14, 2018 at 3:31 PM, James Y Knight 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

Re: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add clang support)

2018-02-14 Thread James Y Knight
t;l...@amacapital.net>; Hansen, > Dave <dave.han...@intel.com>; Tim Chen <tim.c.c...@linux.intel.com>; Greg > Kroah-Hartman <gre...@linux-foundation.org>; Paul Turner <p...@google.com>; > Stephen Hines <srhi...@google.com>; Nick Desaulniers <ndesaulni...@goo

Re: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add clang support)

2018-02-14 Thread James Y Knight
ox ; Rik > van Riel ; Andi Kleen ; Josh Poimboeuf > ; Tom Lendacky ; Peter Zijlstra > ; Linus Torvalds ; Jiri > Kosina ; Andy Lutomirski ; Hansen, > Dave ; Tim Chen ; Greg > Kroah-Hartman ; Paul Turner ; > Stephen Hines ; Nick Desaulniers > Subject: clang asm-goto sup

Re: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add clang support)

2018-02-14 Thread Ingo Molnar
* Peter Zijlstra wrote: > On Wed, Feb 14, 2018 at 09:52:59AM +, Yatsina, Marina wrote: > > Hi Peter, > > > > When I started the original thread last year I was in favor of adding > > "asm goto" and didn't understand why it wasn't done by that time. The > > feedback I

Re: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add clang support)

2018-02-14 Thread Ingo Molnar
* Peter Zijlstra wrote: > On Wed, Feb 14, 2018 at 09:52:59AM +, Yatsina, Marina wrote: > > Hi Peter, > > > > When I started the original thread last year I was in favor of adding > > "asm goto" and didn't understand why it wasn't done by that time. The > > feedback I got is that this

Re: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add clang support)

2018-02-14 Thread Thomas Gleixner
On Wed, 14 Feb 2018, Peter Zijlstra wrote: > On Wed, Feb 14, 2018 at 08:41:43AM +, Chandler Carruth wrote: > > Marina, Kees: > > > > I think the combination of LKML and the LLVM developer's list is probably > > too large a set of folks to have a (somewhat) lengthy exploration of > > options

Re: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add clang support)

2018-02-14 Thread Thomas Gleixner
On Wed, 14 Feb 2018, Peter Zijlstra wrote: > On Wed, Feb 14, 2018 at 08:41:43AM +, Chandler Carruth wrote: > > Marina, Kees: > > > > I think the combination of LKML and the LLVM developer's list is probably > > too large a set of folks to have a (somewhat) lengthy exploration of > > options

Re: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add clang support)

2018-02-14 Thread Peter Zijlstra
On Wed, Feb 14, 2018 at 09:52:59AM +, Yatsina, Marina wrote: > Hi Peter, > > When I started the original thread last year I was in favor of adding > "asm goto" and didn't understand why it wasn't done by that time. The > feedback I got is that this feature (optimizing tracepoints) is very >

Re: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add clang support)

2018-02-14 Thread Peter Zijlstra
On Wed, Feb 14, 2018 at 09:52:59AM +, Yatsina, Marina wrote: > Hi Peter, > > When I started the original thread last year I was in favor of adding > "asm goto" and didn't understand why it wasn't done by that time. The > feedback I got is that this feature (optimizing tracepoints) is very >

RE: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add clang support)

2018-02-14 Thread Yatsina, Marina
et>; Hansen, Dave <dave.han...@intel.com>; Tim Chen <tim.c.c...@linux.intel.com>; Paul Turner <p...@google.com>; Stephen Hines <srhi...@google.com>; Nick Desaulniers <ndesaulni...@google.com> Subject: Re: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add c

RE: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add clang support)

2018-02-14 Thread Yatsina, Marina
lniers Subject: Re: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add clang support) On Wed, Feb 14, 2018 at 08:41:43AM +, Chandler Carruth wrote: > Marina, Kees: > > I think the combination of LKML and the LLVM developer's list is > probably too large a set of fo

RE: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add clang support)

2018-02-14 Thread Yatsina, Marina
.org>; Andy Lutomirski <l...@amacapital.net>; Hansen, Dave <dave.han...@intel.com>; Tim Chen <tim.c.c...@linux.intel.com>; Greg Kroah-Hartman <gre...@linux-foundation.org>; Paul Turner <p...@google.com>; Stephen Hines <srhi...@google.com>; Nick Desaulniers <n

RE: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add clang support)

2018-02-14 Thread Yatsina, Marina
Lutomirski ; Hansen, Dave ; Tim Chen ; Greg Kroah-Hartman ; Paul Turner ; Stephen Hines ; Nick Desaulniers Subject: Re: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add clang support) On Wed, Feb 14, 2018 at 08:33:39AM +, Yatsina, Marina wrote: > I hope this will give thi

Re: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add clang support)

2018-02-14 Thread Greg Kroah-Hartman
On Wed, Feb 14, 2018 at 08:41:43AM +, Chandler Carruth wrote: > Marina, Kees: > > I think the combination of LKML and the LLVM developer's list is probably > too large a set of folks to have a (somewhat) lengthy exploration of > options and how to go about this and find a good path forward.

Re: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add clang support)

2018-02-14 Thread Greg Kroah-Hartman
On Wed, Feb 14, 2018 at 08:41:43AM +, Chandler Carruth wrote: > Marina, Kees: > > I think the combination of LKML and the LLVM developer's list is probably > too large a set of folks to have a (somewhat) lengthy exploration of > options and how to go about this and find a good path forward.

Re: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add clang support)

2018-02-14 Thread Peter Zijlstra
On Wed, Feb 14, 2018 at 08:41:43AM +, Chandler Carruth wrote: > Marina, Kees: > > I think the combination of LKML and the LLVM developer's list is probably > too large a set of folks to have a (somewhat) lengthy exploration of > options and how to go about this and find a good path forward.

Re: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add clang support)

2018-02-14 Thread Peter Zijlstra
On Wed, Feb 14, 2018 at 08:41:43AM +, Chandler Carruth wrote: > Marina, Kees: > > I think the combination of LKML and the LLVM developer's list is probably > too large a set of folks to have a (somewhat) lengthy exploration of > options and how to go about this and find a good path forward.

Re: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add clang support)

2018-02-14 Thread Peter Zijlstra
On Wed, Feb 14, 2018 at 08:33:39AM +, Yatsina, Marina wrote: > I hope this will give this issue a push forward and we will find a > solution that will not prevent llvm from compiling linux kernel. That solution is asm-goto. We (linux kernel) are not going to support something like it. It's

Re: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add clang support)

2018-02-14 Thread Peter Zijlstra
On Wed, Feb 14, 2018 at 08:33:39AM +, Yatsina, Marina wrote: > I hope this will give this issue a push forward and we will find a > solution that will not prevent llvm from compiling linux kernel. That solution is asm-goto. We (linux kernel) are not going to support something like it. It's

RE: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add clang support)

2018-02-14 Thread Yatsina, Marina
..@amacapital.net>; Hansen, Dave <dave.han...@intel.com>; Tim Chen <tim.c.c...@linux.intel.com>; Greg Kroah-Hartman <gre...@linux-foundation.org>; Paul Turner <p...@google.com>; Stephen Hines <srhi...@google.com>; Nick Desaulniers <ndesaulni...@google.com> S

RE: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add clang support)

2018-02-14 Thread Yatsina, Marina
clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add clang support) On Tue, Feb 13, 2018 at 4:10 PM, David Woodhouse wrote: > We also need to resolve the asm-goto thing. Yes, this is becoming much more urgent, assuming we'll be raising the minimum GCC version soon and drop suppor