Re: [PATCH bpf-next v3 0/2] bpf, arm64: support up to 12 arguments

2025-05-27 Thread patchwork-bot+netdevbpf
Hello:

This series was applied to bpf/bpf-next.git (master)
by Alexei Starovoitov :

On Tue, 27 May 2025 12:06:02 +0200 you wrote:
> Hello,
> 
> this is the v2 of the many args series for arm64, being itself a revival
> of Xu Kuhoai's work to enable larger arguments count for BPF programs on
> ARM64 ([1]).
> 
> The discussions in v1 shed some light on some issues around specific
> cases, for example with functions passing struct on stack with custom
> packing/alignment attributes: those cases can not be properly detected
> with the current BTF info. So this new revision aims to separate
> concerns with a simpler implementation, just accepting additional args
> on stack if we can make sure about the alignment constraints (and so,
> refusing attachment to functions passing structs on stacks). I then
> checked if the specific alignment constraints could be checked with
> larger scalar types rather than structs, but it appears that this use
> case is in fact rejected at the verifier level (see a9b59159d338 ("bpf:
> Do not allow btf_ctx_access with __int128 types")). So in the end the
> specific alignment corner cases raised in [1] can not really happen in
> the kernel in its current state. This new revision still brings support
> for the standard cases as a first step, it will then be possible to
> iterate on top of it to add the more specific cases like struct passed
> on stack and larger types.
> 
> [...]

Here is the summary with links:
  - [bpf-next,v3,1/2] bpf, arm64: Support up to 12 function arguments
https://git.kernel.org/bpf/bpf-next/c/9014cf56f13d
  - [bpf-next,v3,2/2] selftests/bpf: enable many-args tests for arm64
https://git.kernel.org/bpf/bpf-next/c/149ead9d7e3d

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





Re: [PATCH bpf-next v3 0/2] bpf, arm64: support up to 12 arguments

2025-05-27 Thread Xu Kuohai

On 5/27/2025 6:06 PM, Alexis Lothoré wrote:

Hello,

this is the v2 of the many args series for arm64, being itself a revival
of Xu Kuhoai's work to enable larger arguments count for BPF programs on
ARM64 ([1]).

The discussions in v1 shed some light on some issues around specific
cases, for example with functions passing struct on stack with custom
packing/alignment attributes: those cases can not be properly detected
with the current BTF info. So this new revision aims to separate
concerns with a simpler implementation, just accepting additional args
on stack if we can make sure about the alignment constraints (and so,
refusing attachment to functions passing structs on stacks). I then
checked if the specific alignment constraints could be checked with
larger scalar types rather than structs, but it appears that this use
case is in fact rejected at the verifier level (see a9b59159d338 ("bpf:
Do not allow btf_ctx_access with __int128 types")). So in the end the
specific alignment corner cases raised in [1] can not really happen in
the kernel in its current state. This new revision still brings support
for the standard cases as a first step, it will then be possible to
iterate on top of it to add the more specific cases like struct passed
on stack and larger types.

[1] 
https://lore.kernel.org/all/[email protected]/#t

Signed-off-by: Alexis Lothoré (eBPF Foundation) 
---
Changes in v3:
- switch back -EOPNOTSUPP to -ENOTSUPP
- fix comment style
- group intializations for arg_aux
- remove some unneeded round_up
- Link to v2: 
https://lore.kernel.org/r/[email protected]

Changes in v2:
- remove alignment computation from btf.c
- deduce alignment constraints directly in jit compiler for simple types
- deny attachment to functions with "corner-cases" arguments (ie:
   structs on stack)
- remove custom tests, as the corresponding use cases are locked either
   by the JIT comp or the verifier
- drop RFC
- Link to v1: 
https://lore.kernel.org/r/[email protected]

---
Alexis Lothoré (eBPF Foundation) (1):
   selftests/bpf: enable many-args tests for arm64

Xu Kuohai (1):
   bpf, arm64: Support up to 12 function arguments

  arch/arm64/net/bpf_jit_comp.c| 225 ---
  tools/testing/selftests/bpf/DENYLIST.aarch64 |   2 -
  2 files changed, 171 insertions(+), 56 deletions(-)
---
base-commit: 9435138c069117cd59a4912b5ea2ae44cc2c5ffa
change-id: 20250220-many_args_arm64-8bd3747e6948

Best regards,


For the series:

Acked-by: Xu Kuohai 




[PATCH bpf-next v3 0/2] bpf, arm64: support up to 12 arguments

2025-05-27 Thread Alexis Lothoré
Hello,

this is the v2 of the many args series for arm64, being itself a revival
of Xu Kuhoai's work to enable larger arguments count for BPF programs on
ARM64 ([1]).

The discussions in v1 shed some light on some issues around specific
cases, for example with functions passing struct on stack with custom
packing/alignment attributes: those cases can not be properly detected
with the current BTF info. So this new revision aims to separate
concerns with a simpler implementation, just accepting additional args
on stack if we can make sure about the alignment constraints (and so,
refusing attachment to functions passing structs on stacks). I then
checked if the specific alignment constraints could be checked with
larger scalar types rather than structs, but it appears that this use
case is in fact rejected at the verifier level (see a9b59159d338 ("bpf:
Do not allow btf_ctx_access with __int128 types")). So in the end the
specific alignment corner cases raised in [1] can not really happen in
the kernel in its current state. This new revision still brings support
for the standard cases as a first step, it will then be possible to
iterate on top of it to add the more specific cases like struct passed
on stack and larger types.

[1] 
https://lore.kernel.org/all/[email protected]/#t

Signed-off-by: Alexis Lothoré (eBPF Foundation) 
---
Changes in v3:
- switch back -EOPNOTSUPP to -ENOTSUPP
- fix comment style
- group intializations for arg_aux
- remove some unneeded round_up
- Link to v2: 
https://lore.kernel.org/r/[email protected]

Changes in v2:
- remove alignment computation from btf.c
- deduce alignment constraints directly in jit compiler for simple types
- deny attachment to functions with "corner-cases" arguments (ie:
  structs on stack)
- remove custom tests, as the corresponding use cases are locked either
  by the JIT comp or the verifier
- drop RFC
- Link to v1: 
https://lore.kernel.org/r/[email protected]

---
Alexis Lothoré (eBPF Foundation) (1):
  selftests/bpf: enable many-args tests for arm64

Xu Kuohai (1):
  bpf, arm64: Support up to 12 function arguments

 arch/arm64/net/bpf_jit_comp.c| 225 ---
 tools/testing/selftests/bpf/DENYLIST.aarch64 |   2 -
 2 files changed, 171 insertions(+), 56 deletions(-)
---
base-commit: 9435138c069117cd59a4912b5ea2ae44cc2c5ffa
change-id: 20250220-many_args_arm64-8bd3747e6948

Best regards,
-- 
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com