get rid of GCC __attribute__((optimize)) for BPF
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest2 patches 13 repliesIn review
- v11 patch 11 repliesSuperseded
Changes in v2 from the cover letter
- 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)
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | bpf: don't rely on GCC __attribute__((optimize)) to disable GCSEinclude/ include/ kernel/ +1 more | +6 | 13 replies | |
| 2/2 | bpf: move interpreter into separate source fileinclude/ kernel/ kernel/ +1 more | +605 | 0 replies |
Reviews trailers per patch
1 of 2 patches has a Reviewed-by or Acked-by.
| Patch | Geert Uytterhoeven | Nick Desaulniers |
|---|---|---|
| 1/2 | T-b | R-b |
| 2/2 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/2] get rid of GCC __attribute__((optimize)) for BPF
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/[email protected]/
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
Signature · 1 line
2.17.1