[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPhsuW5uG98fPostcQYw9Kk9DTczOw6LJUJRb8NfiDVVgJcHwQ@mail.gmail.com>
Date: Thu, 3 Feb 2022 23:41:57 -0800
From: Song Liu <song@...nel.org>
To: bpf <bpf@...r.kernel.org>, Networking <netdev@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>
Cc: Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii@...nel.org>,
Kernel Team <kernel-team@...com>,
Peter Zijlstra <peterz@...radead.org>, X86 ML <x86@...nel.org>,
Ilya Leoshkevich <iii@...ux.ibm.com>
Subject: Re: [PATCH v8 bpf-next 4/9] bpf: use prog->jited_len in bpf_prog_ksym_set_addr()
On Mon, Jan 31, 2022 at 10:31 PM Song Liu <song@...nel.org> wrote:
>
> Using prog->jited_len is simpler and more accurate than current
> estimation (header + header->size).
>
> Signed-off-by: Song Liu <song@...nel.org>
Hmm... CI [1] reports error on test_progs 159/tailcalls, and bisect points to
this one. However, I couldn't figure out why this breaks tail call.
round_up(PAGE_SIZE) does fix it though. But that won't be accurate, right?
Any suggestions on what could be the reason for these failures?
Thanks,
Song
[1] https://github.com/kernel-patches/bpf/runs/5060194776?check_suite_focus=true
> ---
> kernel/bpf/core.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
> index 14199228a6f0..e3fe53df0a71 100644
> --- a/kernel/bpf/core.c
> +++ b/kernel/bpf/core.c
> @@ -537,13 +537,10 @@ long bpf_jit_limit_max __read_mostly;
> static void
> bpf_prog_ksym_set_addr(struct bpf_prog *prog)
> {
> - const struct bpf_binary_header *hdr = bpf_jit_binary_hdr(prog);
> - unsigned long addr = (unsigned long)hdr;
> -
> WARN_ON_ONCE(!bpf_prog_ebpf_jited(prog));
>
> prog->aux->ksym.start = (unsigned long) prog->bpf_func;
> - prog->aux->ksym.end = addr + hdr->size;
> + prog->aux->ksym.end = prog->aux->ksym.start + prog->jited_len;
> }
>
> static void
> --
> 2.30.2
>
Powered by blists - more mailing lists