2022-11-03 13:03:20

by Peter Zijlstra

[permalink] [raw]
Subject: [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.



2022-11-03 14:13:15

by Björn Töpel

[permalink] [raw]
Subject: Re: [PATCH 0/2] bpf: Yet another approach to fix the BPF dispatcher thing

Peter Zijlstra <[email protected]> writes:

> 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.

Took it for a spin on x86_64/KVM. For the series:

Acked-by: Björn Töpel <[email protected]>
Tested-by: Björn Töpel <[email protected]>

2022-11-03 14:56:43

by Jiri Olsa

[permalink] [raw]
Subject: Re: [PATCH 0/2] bpf: Yet another approach to fix the BPF dispatcher thing

On Thu, Nov 03, 2022 at 01:00:12PM +0100, Peter Zijlstra wrote:
> 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.
>

Acked-by: Jiri Olsa <[email protected]>
Tested-by: Jiri Olsa <[email protected]>

thanks,
jirka

2022-11-04 22:53:02

by patchwork-bot+netdevbpf

[permalink] [raw]
Subject: Re: [PATCH 0/2] bpf: Yet another approach to fix the BPF dispatcher thing

Hello:

This series was applied to bpf/bpf.git (master)
by Daniel Borkmann <[email protected]>:

On Thu, 03 Nov 2022 13:00:12 +0100 you wrote:
> 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.
>
> [...]

Here is the summary with links:
- [1/2] bpf: Revert ("Fix dispatcher patchable function entry to 5 bytes nop")
(no matching commit)
- [2/2] bpf: Convert BPF_DISPATCHER to use static_call() (not ftrace)
https://git.kernel.org/bpf/bpf/c/c86df29d11df

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html