From: Alexei Starovoitov <ast@fb.com>
To: Peter Zijlstra <peterz@infradead.org>, Yonghong Song <yhs@fb.com>
Cc: <mingo@kernel.org>, <daniel@iogearbox.net>,
<linux-kernel@vger.kernel.org>, <x86@kernel.org>,
<kernel-team@fb.com>, Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH] x86/cpufeature: guard asm_volatile_goto usage with CC_HAVE_ASM_GOTO
Date: Tue, 10 Apr 2018 14:28:04 -0700 [thread overview]
Message-ID: <552d5866-912e-afde-f25a-77ae8390816d@fb.com> (raw)
In-Reply-To: <20180410210716.GI4082@hirez.programming.kicks-ass.net>
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 static_cpu_has() uses gcc feature asm_volatile_goto construct,
>> which is not supported by clang.
>
> There will be more unconditional asm-goto usage, clang is in the process
> of growing asm-goto.
Eventually yes, but we need a solution today.
Right now all of bpf based tracing is broken because we have to
compile on the fly with clang.
Instead of
#ifdef CC_HAVE_ASM_GOTO
we can replace it with
#ifndef __BPF__
or some other name,
but it's more hacky, since we'd need add -D__BPF__ to samples/bpf
and to all other places that use native clang to compile.
Whereas with 'ifdef CC_HAVE_ASM_GOTO' everything works as-is.
Top kernel makefile defines it and kernel is still compiled with
asm-goto, whereas native clang path for the purpose of compiling
bpf progs doesn't have this define and also fine.
imo this patch is the best solution _today_.
bpf compilation needs kernel headers only. If later you add
unconditional asm-goto to .c, it's all fine.
next prev parent reply other threads:[~2018-04-10 21:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-10 20:42 Yonghong Song
2018-04-10 21:07 ` Peter Zijlstra
2018-04-10 21:28 ` Alexei Starovoitov [this message]
2018-04-13 18:19 ` Peter Zijlstra
2018-04-13 20:42 ` Alexei Starovoitov
2018-04-14 10:11 ` Peter Zijlstra
2018-04-14 20:30 ` Yonghong Song
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=552d5866-912e-afde-f25a-77ae8390816d@fb.com \
--to=ast@fb.com \
--cc=daniel@iogearbox.net \
--cc=kernel-team@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=yhs@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®