From: Ard Biesheuvel <ardb@kernel.org>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: Arvind Sankar <nivedita@alum.mit.edu>,
Alexei Starovoitov <alexei.starovoitov@gmail.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
"open list:BPF JIT for MIPS (32-BIT AND 64-BIT)"
<netdev@vger.kernel.org>,
"open list:BPF JIT for MIPS (32-BIT AND 64-BIT)"
<bpf@vger.kernel.org>, Arnd Bergmann <arnd@arndb.de>,
Nick Desaulniers <ndesaulniers@google.com>,
Randy Dunlap <rdunlap@infradead.org>,
Josh Poimboeuf <jpoimboe@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Peter Zijlstra <peterz@infradead.org>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Kees Cook <keescook@chromium.org>,
linux-toolchains@vger.kernel.org
Subject: Re: [PATCH v2 1/2] bpf: don't rely on GCC __attribute__((optimize)) to disable GCSE
Date: Thu, 29 Oct 2020 23:13:04 +0100 [thread overview]
Message-ID: <CAMj1kXHxX+u5-cN0v3SLdqZTSiKsWsFOvc2SC5=-ScaUZOu8Ng@mail.gmail.com> (raw)
In-Reply-To: <20201029203113.GJ2672@gate.crashing.org>
On Thu, 29 Oct 2020 at 21:35, Segher Boessenkool
<segher@kernel.crashing.org> wrote:
>
> On Wed, Oct 28, 2020 at 10:57:45PM -0400, Arvind Sankar wrote:
> > On Wed, Oct 28, 2020 at 04:20:01PM -0700, Alexei Starovoitov wrote:
> > > All compilers have bugs. Kernel has bugs. What can go wrong?
>
> Heh.
>
> > +linux-toolchains. GCC updated the documentation in 7.x to discourage
> > people from using the optimize attribute.
> >
> > https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=893100c3fa9b3049ce84dcc0c1a839ddc7a21387
>
> https://patchwork.ozlabs.org/project/gcc/patch/20151213081911.GA320@x4/
> has all the discussion around that GCC patch.
>
For everyone's convenience, let me reproduce here how the GCC
developers describe this attribute on their wiki [0]:
"""
Currently (2015), this attribute is known to have several critical
bugs (PR37565, PR63401, PR60580, PR50782). Using it may produce not
effect at all or lead to wrong-code.
Quoting one GCC maintainer: "I consider the optimize attribute code
seriously broken and unmaintained (but sometimes useful for debugging
- and only that)." source
Unfortunately, the people who added it are either not working on GCC
anymore or not interested in fixing it. Do not try to guess how it is
supposed to work by trial-and-error. There is not a list of options
that are safe to use or known to be broken. Bug reports about the
optimize attribute being broken will probably be closed as WONTFIX
(PR59262), thus it is not worth to open new ones. If it works for you
for a given version of GCC, it doesn't mean it will work on a
different machine or a different version.
The only realistic choices are to not use it, to use it and accept its
brokenness (current or future one, since it is unmaintained), or join
GCC and fix it (perhaps motivating other people along the way to join
your effort).
"""
[0] https://gcc.gnu.org/wiki/FAQ#optimize_attribute_broken
next prev parent reply other threads:[~2020-10-29 22:13 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-28 17:15 [PATCH v2 0/2] get rid of GCC __attribute__((optimize)) for BPF Ard Biesheuvel
2020-10-28 17:15 ` [PATCH v2 1/2] bpf: don't rely on GCC __attribute__((optimize)) to disable GCSE Ard Biesheuvel
2020-10-28 21:39 ` Alexei Starovoitov
2020-10-28 22:15 ` Ard Biesheuvel
2020-10-28 22:59 ` Alexei Starovoitov
2020-10-28 23:10 ` Ard Biesheuvel
2020-10-28 23:20 ` Alexei Starovoitov
2020-10-29 2:57 ` Arvind Sankar
2020-10-29 20:31 ` Segher Boessenkool
2020-10-29 22:13 ` Ard Biesheuvel [this message]
2020-10-30 0:28 ` Nick Desaulniers
2020-10-30 3:22 ` Alexei Starovoitov
2020-10-30 7:51 ` Ard Biesheuvel
2020-10-29 8:25 ` Geert Uytterhoeven
2020-10-30 0:34 ` Nick Desaulniers
2020-10-28 17:15 ` [PATCH v2 2/2] bpf: move interpreter into separate source file Ard Biesheuvel
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='CAMj1kXHxX+u5-cN0v3SLdqZTSiKsWsFOvc2SC5=-ScaUZOu8Ng@mail.gmail.com' \
--to=ardb@kernel.org \
--cc=alexei.starovoitov@gmail.com \
--cc=arnd@arndb.de \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=geert@linux-m68k.org \
--cc=jpoimboe@redhat.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-toolchains@vger.kernel.org \
--cc=ndesaulniers@google.com \
--cc=netdev@vger.kernel.org \
--cc=nivedita@alum.mit.edu \
--cc=peterz@infradead.org \
--cc=rdunlap@infradead.org \
--cc=segher@kernel.crashing.org \
--cc=tglx@linutronix.de \
--subject='Re: [PATCH v2 1/2] bpf: don'\''t rely on GCC __attribute__((optimize)) to disable GCSE' \
/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).