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: [PATCH v2] x86/retpoline: Add clang support

2018-02-14 Thread Guenter Roeck
On Wed, Feb 14, 2018 at 01:09:29PM +, David Woodhouse wrote: > > > On Tue, 2018-02-13 at 18:18 -0800, Guenter Roeck wrote: > > > > > We're going to need the percpu.h fix too, and I'd also like to see the > > > status of the i915 build failure you mentioned. Is there a bug filed > > > for

Re: [PATCH v2] x86/retpoline: Add clang support

2018-02-14 Thread Guenter Roeck
On Wed, Feb 14, 2018 at 01:09:29PM +, David Woodhouse wrote: > > > On Tue, 2018-02-13 at 18:18 -0800, Guenter Roeck wrote: > > > > > We're going to need the percpu.h fix too, and I'd also like to see the > > > status of the i915 build failure you mentioned. Is there a bug filed > > > for

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: [PATCH v2] x86/retpoline: Add clang support

2018-02-14 Thread David Woodhouse
On Tue, 2018-02-13 at 18:18 -0800, Guenter Roeck wrote: > > > We're going to need the percpu.h fix too, and I'd also like to see the > > status of the i915 build failure you mentioned. Is there a bug filed > > for that already, and is it on the blocker list for 6.0? If not, why > > not? > >  >

Re: [PATCH v2] x86/retpoline: Add clang support

2018-02-14 Thread David Woodhouse
On Tue, 2018-02-13 at 18:18 -0800, Guenter Roeck wrote: > > > We're going to need the percpu.h fix too, and I'd also like to see the > > status of the i915 build failure you mentioned. Is there a bug filed > > for that already, and is it on the blocker list for 6.0? If not, why > > not? > >  >

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

Re: [PATCH v2] x86/retpoline: Add clang support

2018-02-13 Thread Guenter Roeck
On 02/13/2018 04:10 PM, David Woodhouse wrote: On Tue, 2018-02-13 at 15:41 -0800, Guenter Roeck wrote: Hi David, On Wed, Feb 07, 2018 at 03:32:11PM -0800, Guenter Roeck wrote: [ ... ] See http://git.infradead.org/users/dwmw2/linux-retpoline.git/commitdiff/82a1f41600 Any chance to see a

Re: [PATCH v2] x86/retpoline: Add clang support

2018-02-13 Thread Guenter Roeck
On 02/13/2018 04:10 PM, David Woodhouse wrote: On Tue, 2018-02-13 at 15:41 -0800, Guenter Roeck wrote: Hi David, On Wed, Feb 07, 2018 at 03:32:11PM -0800, Guenter Roeck wrote: [ ... ] See http://git.infradead.org/users/dwmw2/linux-retpoline.git/commitdiff/82a1f41600 Any chance to see a

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

2018-02-13 Thread Kees Cook
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 support for lacking asm-goto... Do you happen to know who the right

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

2018-02-13 Thread Kees Cook
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 support for lacking asm-goto... Do you happen to know who the right people are to include

Re: [PATCH v2] x86/retpoline: Add clang support

2018-02-13 Thread David Woodhouse
On Tue, 2018-02-13 at 15:41 -0800, Guenter Roeck wrote: > Hi David, > > On Wed, Feb 07, 2018 at 03:32:11PM -0800, Guenter Roeck wrote: > [ ... ] > > >  > > > See > > > http://git.infradead.org/users/dwmw2/linux-retpoline.git/commitdiff/82a1f41600 > > Any chance to see a patch with this change

Re: [PATCH v2] x86/retpoline: Add clang support

2018-02-13 Thread David Woodhouse
On Tue, 2018-02-13 at 15:41 -0800, Guenter Roeck wrote: > Hi David, > > On Wed, Feb 07, 2018 at 03:32:11PM -0800, Guenter Roeck wrote: > [ ... ] > > >  > > > See > > > http://git.infradead.org/users/dwmw2/linux-retpoline.git/commitdiff/82a1f41600 > > Any chance to see a patch with this change

Re: [PATCH v2] x86/retpoline: Add clang support

2018-02-13 Thread Guenter Roeck
Hi David, On Wed, Feb 07, 2018 at 03:32:11PM -0800, Guenter Roeck wrote: [ ... ] > > > > See > > http://git.infradead.org/users/dwmw2/linux-retpoline.git/commitdiff/82a1f41600 Any chance to see a patch with this change anytime soon ? Thanks, Guenter

Re: [PATCH v2] x86/retpoline: Add clang support

2018-02-13 Thread Guenter Roeck
Hi David, On Wed, Feb 07, 2018 at 03:32:11PM -0800, Guenter Roeck wrote: [ ... ] > > > > See > > http://git.infradead.org/users/dwmw2/linux-retpoline.git/commitdiff/82a1f41600 Any chance to see a patch with this change anytime soon ? Thanks, Guenter

Re: [PATCH v2] x86/retpoline: Add clang support

2018-02-07 Thread Guenter Roeck
On Wed, Feb 07, 2018 at 10:28:38PM +, David Woodhouse wrote: > > > On Wed, 2018-02-07 at 13:52 -0800, Guenter Roeck wrote: > > clang has its own set of compiler options for retpoline support. > > > > Link: > >

Re: [PATCH v2] x86/retpoline: Add clang support

2018-02-07 Thread Guenter Roeck
On Wed, Feb 07, 2018 at 10:28:38PM +, David Woodhouse wrote: > > > On Wed, 2018-02-07 at 13:52 -0800, Guenter Roeck wrote: > > clang has its own set of compiler options for retpoline support. > > > > Link: > >

Re: [PATCH v2] x86/retpoline: Add clang support

2018-02-07 Thread Guenter Roeck
On Wed, Feb 07, 2018 at 10:28:38PM +, David Woodhouse wrote: > > > On Wed, 2018-02-07 at 13:52 -0800, Guenter Roeck wrote: > > clang has its own set of compiler options for retpoline support. > > > > Link: > >

Re: [PATCH v2] x86/retpoline: Add clang support

2018-02-07 Thread Guenter Roeck
On Wed, Feb 07, 2018 at 10:28:38PM +, David Woodhouse wrote: > > > On Wed, 2018-02-07 at 13:52 -0800, Guenter Roeck wrote: > > clang has its own set of compiler options for retpoline support. > > > > Link: > >

Re: [PATCH v2] x86/retpoline: Add clang support

2018-02-07 Thread David Woodhouse
On Wed, 2018-02-07 at 13:52 -0800, Guenter Roeck wrote: > clang has its own set of compiler options for retpoline support. > > Link: > https://github.com/llvm-mirror/clang/commit/0d816739a82da29748caf88570affb9715e18b69 > Link: >

Re: [PATCH v2] x86/retpoline: Add clang support

2018-02-07 Thread David Woodhouse
On Wed, 2018-02-07 at 13:52 -0800, Guenter Roeck wrote: > clang has its own set of compiler options for retpoline support. > > Link: > https://github.com/llvm-mirror/clang/commit/0d816739a82da29748caf88570affb9715e18b69 > Link: >

[PATCH v2] x86/retpoline: Add clang support

2018-02-07 Thread Guenter Roeck
clang has its own set of compiler options for retpoline support. Link: https://github.com/llvm-mirror/clang/commit/0d816739a82da29748caf88570affb9715e18b69 Link: https://github.com/llvm-mirror/llvm/commit/fd5a8723ce9f2a6b250e85972ef859e4253ea95d Link:

[PATCH v2] x86/retpoline: Add clang support

2018-02-07 Thread Guenter Roeck
clang has its own set of compiler options for retpoline support. Link: https://github.com/llvm-mirror/clang/commit/0d816739a82da29748caf88570affb9715e18b69 Link: https://github.com/llvm-mirror/llvm/commit/fd5a8723ce9f2a6b250e85972ef859e4253ea95d Link: