All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ardb@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org, arnd@arndb.de,
	Ard Biesheuvel <ardb@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Arvind Sankar <nivedita@alum.mit.edu>,
	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>
Subject: [PATCH v2 0/2] get rid of GCC __attribute__((optimize)) for BPF
Date: Wed, 28 Oct 2020 18:15:04 +0100	[thread overview]
Message-ID: <20201028171506.15682-1-ardb@kernel.org> (raw)

This is a followup to [0]:
[PATCH] bpf: don't rely on GCC __attribute__((optimize)) to disable GCSE[0]

Changes since v1:
- only use -fno-gcse when CONFIG_BPF_JIT_ALWAYS_ON=y and CONFIG_CC_IS_GCC=y
  (but ignore CONFIG_RETPOLINE since we want to avoid GCSE in all cases)
- to avoid potential impact of disabling GCSE on other code, put the
  interpreter in a separate file (patch #2)

Note that patch #1 is intended for backporting, as function scope GCC
optimization attributes are really quite broken.

I don't have a strong opinion on whether the interpreter code should be
split off or not, but it looks like it can be done fairly painlessly,
so it is probably a good idea to do it anyway.

[0] https://lore.kernel.org/bpf/20201027205723.12514-1-ardb@kernel.org/

Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Arvind Sankar <nivedita@alum.mit.edu>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Kees Cook <keescook@chromium.org>

Ard Biesheuvel (2):
  bpf: don't rely on GCC __attribute__((optimize)) to disable GCSE
  bpf: move interpreter into separate source file

 include/linux/compiler-gcc.h   |   2 -
 include/linux/compiler_types.h |   4 -
 include/linux/filter.h         |   1 +
 kernel/bpf/Makefile            |   7 +-
 kernel/bpf/core.c              | 567 ------------------
 kernel/bpf/interp.c            | 601 ++++++++++++++++++++
 6 files changed, 607 insertions(+), 575 deletions(-)
 create mode 100644 kernel/bpf/interp.c

-- 
2.17.1


             reply	other threads:[~2020-10-29  1:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-28 17:15 Ard Biesheuvel [this message]
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
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=20201028171506.15682-1-ardb@kernel.org \
    --to=ardb@kernel.org \
    --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=ndesaulniers@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=nivedita@alum.mit.edu \
    --cc=peterz@infradead.org \
    --cc=rdunlap@infradead.org \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.