diff mbox series

[v3] bpf: s390: add JIT support for bpf line info

Message ID 20190830115109.3896-1-yauheni.kaliuta@redhat.com
State Accepted
Delegated to: BPF Maintainers
Headers show
Series [v3] bpf: s390: add JIT support for bpf line info | expand

Commit Message

Yauheni Kaliuta Aug. 30, 2019, 11:51 a.m. UTC
This adds support for generating bpf line info for JITed programs
like commit 6f20c71d8505 ("bpf: powerpc64: add JIT support for bpf
line info") does for powerpc, but it should pass the array starting
from 1 like x86, see commit 7c2e988f400e ("bpf: fix x64 JIT code
generation for jmp to 1st insn").

That fixes test_btf.

Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
---

The patch is on top of "bpf: s390: add JIT support for multi-function
programs"
 
V1->V2:

- pass address array starting from element 1.

V2->V3:

- Fix braces in the commit message.

---
 arch/s390/net/bpf_jit_comp.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Daniel Borkmann Sept. 3, 2019, 1:40 p.m. UTC | #1
On 8/30/19 1:51 PM, Yauheni Kaliuta wrote:
> This adds support for generating bpf line info for JITed programs
> like commit 6f20c71d8505 ("bpf: powerpc64: add JIT support for bpf
> line info") does for powerpc, but it should pass the array starting
> from 1 like x86, see commit 7c2e988f400e ("bpf: fix x64 JIT code
> generation for jmp to 1st insn").
> 
> That fixes test_btf.
> 
> Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>

Applied, thanks! Few notes: please carry on Acked-by/Tested-by from
prior version since there haven't been fundamental changes. I've done
that manually now. Also, the reference above to x86 is somewhat
misleading since both JITs fill the addr array in a different manner
and the commit you've referenced is a bug fix (which would be good
if someone double checks on s390x).

Thanks,
Daniel
diff mbox series

Patch

diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c
index b6801d854c77..ce88211b9c6c 100644
--- a/arch/s390/net/bpf_jit_comp.c
+++ b/arch/s390/net/bpf_jit_comp.c
@@ -1420,6 +1420,7 @@  struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp)
 	fp->jited_len = jit.size;
 
 	if (!fp->is_func || extra_pass) {
+		bpf_prog_fill_jited_linfo(fp, jit.addrs + 1);
 free_addrs:
 		kfree(jit.addrs);
 		kfree(jit_data);