Skip to content

bpf: Yet another approach to fix the BPF dispatcher thing

Peter Zijlstra bpf lkml netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 3 repliesIn review 1 of 2 applied

Patches in v1 1 of 2 applied

#Subject and filesSizeRepliesApplied
1/2bpf: Revert ("Fix dispatcher patchable function entry to 5 bytes nop")arch/x86/net/bpf_jit_comp.c include/linux/bpf.h kernel/bpf/dispatcher.c+1 -390 replies
2/2bpf: Convert BPF_DISPATCHER to use static_call() (not ftrace)include/linux/bpf.h kernel/bpf/dispatcher.c+46 -151 replyApplied

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchBjörn TöpelJiri OlsaSteven Rostedt (Google)
SeriesA-b T-b A-b T-b
1/2
2/2A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [PATCH 0/2] bpf: Yet another approach to fix the BPF dispatcher thing

Hi!

Even thought the __attribute__((patchable_function_entry())) solution to the BPF dispatcher woes works, it turns out to not be supported by the whole range of ageing compilers we support. Specifically this attribute seems to be GCC-8 and later.

This is another approach -- using static_call() to rewrite the dispatcher function. I've compile tested this on:

x86_64 (inline static-call support)
i386 (out-of-line static-call support)
aargh64 (no static-call support)

A previous version was tested and found working by Bjorn.

It is split in two patches; first reverting the current approach and then introducing the new for ease of review.