All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ilya Leoshkevich <iii@linux.ibm.com>
To: Song Liu <song@kernel.org>, bpf@vger.kernel.org
Cc: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
	martin.lau@linux.dev, kernel-team@meta.com
Subject: Re: [PATCH bpf 1/2] s390/bpf: Let arch_prepare_bpf_trampoline return program size
Date: Tue, 19 Sep 2023 11:04:11 +0200	[thread overview]
Message-ID: <46773a5423f050e1f763fbf6a24fbd8ec2ae86e7.camel@linux.ibm.com> (raw)
In-Reply-To: <20230919060258.3237176-2-song@kernel.org>

On Mon, 2023-09-18 at 23:02 -0700, Song Liu wrote:
> arch_prepare_bpf_trampoline() for s390 currently returns 0 on
> success. This
> is not a problem for regular trampoline. However, struct_ops relies
> on the
> return value to advance "image" pointer:
> 
> bpf_struct_ops_map_update_elem() {
>     ...
>     for_each_member(i, t, member) {
>         ...
>         err = bpf_struct_ops_prepare_trampoline();
>         ...
>         image += err;
>     }
> }
> 
> When arch_prepare_bpf_trampoline returns 0 on success, all members of
> the
> struct_ops will point to the same trampoline (the last one).
> 
> Fix this by returning the program size in arch_prepare_bpf_trampoline
> (on
> success). This is the same behavior as other architectures.
> 
> Signed-off-by: Song Liu <song@kernel.org>
> ---
>  arch/s390/net/bpf_jit_comp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Thanks!

Fixes: 528eb2cb87bc ("s390/bpf: Implement
arch_prepare_bpf_trampoline()")
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>

  reply	other threads:[~2023-09-19  9:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-19  6:02 [PATCH bpf 0/2] s390/bpf: Fix arch_prepare_bpf_trampoline Song Liu
2023-09-19  6:02 ` [PATCH bpf 1/2] s390/bpf: Let arch_prepare_bpf_trampoline return program size Song Liu
2023-09-19  9:04   ` Ilya Leoshkevich [this message]
2023-09-19  6:02 ` [PATCH bpf 2/2] selftests/bpf: Check bpf_cubic_acked() is called via struct_ops Song Liu
2023-09-19  9:05   ` Ilya Leoshkevich
2023-09-19 10:10 ` [PATCH bpf 0/2] s390/bpf: Fix arch_prepare_bpf_trampoline patchwork-bot+netdevbpf

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=46773a5423f050e1f763fbf6a24fbd8ec2ae86e7.camel@linux.ibm.com \
    --to=iii@linux.ibm.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@meta.com \
    --cc=martin.lau@linux.dev \
    --cc=song@kernel.org \
    /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.