[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220703030210.pmjft7qc2eajzi6c@alap3.anarazel.de>
Date: Sat, 2 Jul 2022 20:02:10 -0700
From: Andres Freund <andres@...razel.de>
To: Song Liu <song@...nel.org>
Cc: bpf@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, ast@...nel.org, daniel@...earbox.net,
andrii@...nel.org, kernel-team@...com, peterz@...radead.org,
x86@...nel.org, iii@...ux.ibm.com, Song Liu <songliubraving@...com>
Subject: Re: [PATCH v9 bpf-next 9/9] bpf, x86_64: use
bpf_jit_binary_pack_alloc
Hi,
On 2022-02-04 10:57:42 -0800, Song Liu wrote:
> From: Song Liu <songliubraving@...com>
>
> Use bpf_jit_binary_pack_alloc in x86_64 jit. The jit engine first writes
> the program to the rw buffer. When the jit is done, the program is copied
> to the final location with bpf_jit_binary_pack_finalize.
>
> Note that we need to do bpf_tail_call_direct_fixup after finalize.
> Therefore, the text_live = false logic in __bpf_arch_text_poke is no
> longer needed.
I think this broke bpf_jit_enable = 2. I just tried to use that, to verify I
didn't break tools/bpf/bpf_jit_disasm, and I just see output like
Jul 02 18:34:40 awork3 kernel: flen=142 proglen=735 pass=5 image=00000000d076e0db from=sshd pid=440127
Jul 02 18:34:40 awork3 kernel: JIT code: 00000000: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
Jul 02 18:34:40 awork3 kernel: JIT code: 00000010: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
Jul 02 18:34:40 awork3 kernel: JIT code: 00000020: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
Jul 02 18:34:40 awork3 kernel: JIT code: 00000030: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
...
while bpftool keeps showing reasonable content. The 'cc' content only started
with a later commit, but I think this is the commit that broke bpf_jit_enable
== 2.
At the time bpf_jit_dump() is called bpf_jit_binary_pack_alloc() pointed image to
ro_header->image, but that's not yet written to, because
bpf_jit_binary_pack_finalize() hasn't been called.
Greetings,
Andres Freund
Powered by blists - more mailing lists