LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Yonghong Song <yhs@fb.com>
Cc: mingo@kernel.org, ast@fb.com, daniel@iogearbox.net,
linux-kernel@vger.kernel.org, x86@kernel.org, kernel-team@fb.com
Subject: Re: [PATCH v2] x86/cpufeature: guard asm_volatile_goto usage with NO_BPF_WORKAROUND
Date: Mon, 23 Apr 2018 12:52:09 +0200 [thread overview]
Message-ID: <20180423105209.GX4064@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <fd14097e-31c5-0c0e-cbe5-d399299ca489@fb.com>
On Fri, Apr 20, 2018 at 11:06:03AM -0700, Yonghong Song wrote:
> On 4/20/18 1:19 AM, Peter Zijlstra wrote:
> > Hurm, so adding __BPF__ for BPF compiles isn't an option? It seems to me
> > having a CPP flag to identify BPF compile context might be useful in
> > general.
>
> With "clang -target bpf", we already have __BPF__ defined.
> For tracing, esp. ptrace.h is included, "clang -target <native_arch>" where
> "-target <native_arch>" can be omitted, is typically used.
> The reason is the native architecture header files typically
> include a lot of various asm related stuff where "-target bpf" cannot
> really handle. We relay on native clang to flush out all these
> asm constructs and only bpf program needed stuff survives
> reach to backend compiler.
So because 'clang -target bpf' is 'broken', you do a work-around using
'clang -target <native_arch>'. But because that doesn't set __BPF__ you
want to add NO_BPF_WORKAROUND to the kernel instead of adding __BPF__ to
your build rules to better mimick -target bpf, which you should be
using.
How is that sane? Why not use 'clang -target <native_arch> -D__BPF__'
next prev parent reply other threads:[~2018-04-23 10:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-15 4:27 Yonghong Song
2018-04-19 16:36 ` Yonghong Song
2018-04-20 8:19 ` Peter Zijlstra
2018-04-20 18:06 ` Yonghong Song
2018-04-23 10:52 ` Peter Zijlstra [this message]
2018-04-23 16:50 ` Yonghong Song
2018-04-27 16:34 ` Yonghong Song
2018-05-02 14:01 ` 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=20180423105209.GX4064@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=ast@fb.com \
--cc=daniel@iogearbox.net \
--cc=kernel-team@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=x86@kernel.org \
--cc=yhs@fb.com \
--subject='Re: [PATCH v2] x86/cpufeature: guard asm_volatile_goto usage with NO_BPF_WORKAROUND' \
/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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).