Re: [PATCH] x86/cpufeature: guard asm_volatile_goto usage with CC_HAVE_ASM_GOTO

2018-04-14 Thread Yonghong Song
On 4/14/18 3:11 AM, Peter Zijlstra wrote: On Fri, Apr 13, 2018 at 01:42:14PM -0700, Alexei Starovoitov wrote: On 4/13/18 11:19 AM, Peter Zijlstra wrote: On Tue, Apr 10, 2018 at 02:28:04PM -0700, Alexei Starovoitov wrote: Instead of #ifdef CC_HAVE_ASM_GOTO we can replace it with #ifndef

Re: [PATCH] x86/cpufeature: guard asm_volatile_goto usage with CC_HAVE_ASM_GOTO

2018-04-14 Thread Yonghong Song
On 4/14/18 3:11 AM, Peter Zijlstra wrote: On Fri, Apr 13, 2018 at 01:42:14PM -0700, Alexei Starovoitov wrote: On 4/13/18 11:19 AM, Peter Zijlstra wrote: On Tue, Apr 10, 2018 at 02:28:04PM -0700, Alexei Starovoitov wrote: Instead of #ifdef CC_HAVE_ASM_GOTO we can replace it with #ifndef

Re: [PATCH] x86/cpufeature: guard asm_volatile_goto usage with CC_HAVE_ASM_GOTO

2018-04-14 Thread Peter Zijlstra
On Fri, Apr 13, 2018 at 01:42:14PM -0700, Alexei Starovoitov wrote: > On 4/13/18 11:19 AM, Peter Zijlstra wrote: > > On Tue, Apr 10, 2018 at 02:28:04PM -0700, Alexei Starovoitov wrote: > > > Instead of > > > #ifdef CC_HAVE_ASM_GOTO > > > we can replace it with > > > #ifndef __BPF__ > > > or some

Re: [PATCH] x86/cpufeature: guard asm_volatile_goto usage with CC_HAVE_ASM_GOTO

2018-04-14 Thread Peter Zijlstra
On Fri, Apr 13, 2018 at 01:42:14PM -0700, Alexei Starovoitov wrote: > On 4/13/18 11:19 AM, Peter Zijlstra wrote: > > On Tue, Apr 10, 2018 at 02:28:04PM -0700, Alexei Starovoitov wrote: > > > Instead of > > > #ifdef CC_HAVE_ASM_GOTO > > > we can replace it with > > > #ifndef __BPF__ > > > or some

Re: [PATCH] x86/cpufeature: guard asm_volatile_goto usage with CC_HAVE_ASM_GOTO

2018-04-13 Thread Alexei Starovoitov
On 4/13/18 11:19 AM, Peter Zijlstra wrote: On Tue, Apr 10, 2018 at 02:28:04PM -0700, Alexei Starovoitov wrote: Instead of #ifdef CC_HAVE_ASM_GOTO we can replace it with #ifndef __BPF__ or some other name, I would prefer the BPF specific hack; otherwise we might be encouraging people to build

Re: [PATCH] x86/cpufeature: guard asm_volatile_goto usage with CC_HAVE_ASM_GOTO

2018-04-13 Thread Alexei Starovoitov
On 4/13/18 11:19 AM, Peter Zijlstra wrote: On Tue, Apr 10, 2018 at 02:28:04PM -0700, Alexei Starovoitov wrote: Instead of #ifdef CC_HAVE_ASM_GOTO we can replace it with #ifndef __BPF__ or some other name, I would prefer the BPF specific hack; otherwise we might be encouraging people to build

Re: [PATCH] x86/cpufeature: guard asm_volatile_goto usage with CC_HAVE_ASM_GOTO

2018-04-13 Thread Peter Zijlstra
On Tue, Apr 10, 2018 at 02:28:04PM -0700, Alexei Starovoitov wrote: > Instead of > #ifdef CC_HAVE_ASM_GOTO > we can replace it with > #ifndef __BPF__ > or some other name, I would prefer the BPF specific hack; otherwise we might be encouraging people to build the kernel proper without asm-goto.

Re: [PATCH] x86/cpufeature: guard asm_volatile_goto usage with CC_HAVE_ASM_GOTO

2018-04-13 Thread Peter Zijlstra
On Tue, Apr 10, 2018 at 02:28:04PM -0700, Alexei Starovoitov wrote: > Instead of > #ifdef CC_HAVE_ASM_GOTO > we can replace it with > #ifndef __BPF__ > or some other name, I would prefer the BPF specific hack; otherwise we might be encouraging people to build the kernel proper without asm-goto.

Re: [PATCH] x86/cpufeature: guard asm_volatile_goto usage with CC_HAVE_ASM_GOTO

2018-04-10 Thread Alexei Starovoitov
On 4/10/18 2:07 PM, Peter Zijlstra wrote: On Tue, Apr 10, 2018 at 01:42:59PM -0700, Yonghong Song wrote: Commit d0266046ad54 ("x86: Remove FAST_FEATURE_TESTS") removed X86_FAST_FEATURE_TESTS and make macro static_cpu_has() always use __always_inline function _static_cpu_has() funciton. The

Re: [PATCH] x86/cpufeature: guard asm_volatile_goto usage with CC_HAVE_ASM_GOTO

2018-04-10 Thread Alexei Starovoitov
On 4/10/18 2:07 PM, Peter Zijlstra wrote: On Tue, Apr 10, 2018 at 01:42:59PM -0700, Yonghong Song wrote: Commit d0266046ad54 ("x86: Remove FAST_FEATURE_TESTS") removed X86_FAST_FEATURE_TESTS and make macro static_cpu_has() always use __always_inline function _static_cpu_has() funciton. The

Re: [PATCH] x86/cpufeature: guard asm_volatile_goto usage with CC_HAVE_ASM_GOTO

2018-04-10 Thread Peter Zijlstra
On Tue, Apr 10, 2018 at 01:42:59PM -0700, Yonghong Song wrote: > Commit d0266046ad54 ("x86: Remove FAST_FEATURE_TESTS") > removed X86_FAST_FEATURE_TESTS and make macro static_cpu_has() always > use __always_inline function _static_cpu_has() funciton. > The static_cpu_has() uses gcc feature

Re: [PATCH] x86/cpufeature: guard asm_volatile_goto usage with CC_HAVE_ASM_GOTO

2018-04-10 Thread Peter Zijlstra
On Tue, Apr 10, 2018 at 01:42:59PM -0700, Yonghong Song wrote: > Commit d0266046ad54 ("x86: Remove FAST_FEATURE_TESTS") > removed X86_FAST_FEATURE_TESTS and make macro static_cpu_has() always > use __always_inline function _static_cpu_has() funciton. > The static_cpu_has() uses gcc feature

[PATCH] x86/cpufeature: guard asm_volatile_goto usage with CC_HAVE_ASM_GOTO

2018-04-10 Thread Yonghong Song
Commit d0266046ad54 ("x86: Remove FAST_FEATURE_TESTS") removed X86_FAST_FEATURE_TESTS and make macro static_cpu_has() always use __always_inline function _static_cpu_has() funciton. The static_cpu_has() uses gcc feature asm_volatile_goto construct, which is not supported by clang. Currently, for

[PATCH] x86/cpufeature: guard asm_volatile_goto usage with CC_HAVE_ASM_GOTO

2018-04-10 Thread Yonghong Song
Commit d0266046ad54 ("x86: Remove FAST_FEATURE_TESTS") removed X86_FAST_FEATURE_TESTS and make macro static_cpu_has() always use __always_inline function _static_cpu_has() funciton. The static_cpu_has() uses gcc feature asm_volatile_goto construct, which is not supported by clang. Currently, for