btf_ext__endianness() and btf_ext__set_endianness()
for query and setting byte-order, as already exist for BTF data.
[1] 3289959b97ca ("libbpf: Support BTF loading and raw data output in both
endianness")
[2] 8fd27bf69b86 ("libbpf: Add BPF static linker BTF and BTF.ext support")
Signed-o
Allow bpf_object__open() to access files of either endianness, and convert
included BPF programs to native byte-order in-memory for introspection.
Loading BPF objects of non-native byte-order is still disallowed however.
Signed-off-by: Tony Ambardar
---
tools/lib/bpf/libbpf.c | 49
On Fri, Aug 30, 2024 at 03:15:10PM -0700, Eduard Zingerman wrote:
> On Fri, 2024-08-30 at 00:29 -0700, Tony Ambardar wrote:
> > Object linking output data uses the default ELF_T_BYTE type for '.symtab'
> > section data, which disables any libelf-based translation. Explici
On Fri, Aug 30, 2024 at 06:24:47PM -0700, Alexei Starovoitov wrote:
> On Fri, Aug 30, 2024 at 2:31 PM Andrii Nakryiko
> wrote:
> >
> >
> >
> > for the rest, Alexei, can you please review and give your ack?
>
> It looks fine.
> All of the additional pr_debug()s look a bit excessive.
> Will take an
On Fri, Aug 30, 2024 at 02:25:54PM -0700, Andrii Nakryiko wrote:
> On Fri, Aug 30, 2024 at 12:30 AM Tony Ambardar
> wrote:
> >
> > Allow bpf_object__open() to access files of either endianness, and convert
> > included BPF programs to native byte-order in-memory for in
On Fri, Aug 30, 2024 at 06:16:25PM -0700, Eduard Zingerman wrote:
> On Fri, 2024-08-30 at 00:29 -0700, Tony Ambardar wrote:
>
> [...]
>
> > @@ -940,6 +942,21 @@ bpf_object__add_programs(struct bpf_object *obj,
> > Elf_Data *sec_data,
> > return 0;
On Fri, Aug 30, 2024 at 02:30:46PM -0700, Andrii Nakryiko wrote:
> On Fri, Aug 30, 2024 at 12:30 AM Tony Ambardar
> wrote:
> >
> > Track target endianness in 'struct bpf_gen' and process in-memory data in
> > native byte-order, but on finalization convert th
On Fri, Aug 30, 2024 at 06:26:10PM -0700, Eduard Zingerman wrote:
> On Fri, 2024-08-30 at 14:25 -0700, Andrii Nakryiko wrote:
>
> [...]
>
> > > err = bpf_object__elf_init(obj);
> > > - err = err ? : bpf_object__check_endianness(obj);
> > > err = err ? : bpf_object__elf_colle
On Fri, Aug 30, 2024 at 02:25:07PM -0700, Andrii Nakryiko wrote:
> On Fri, Aug 30, 2024 at 12:30 AM Tony Ambardar
> wrote:
> >
> > Allow static linking object files of either endianness, checking that input
> > files have consistent byte-order, and setting outp
On Fri, Aug 30, 2024 at 02:14:19PM -0700, Andrii Nakryiko wrote:
> On Fri, Aug 30, 2024 at 12:30 AM Tony Ambardar
> wrote:
> >
> > Support for handling BTF data of either endianness was added in [1], but
> > did not include BTF.ext data for lack of use cases. Later
fixed a light skeleton bug causing test_progs 'map_ptr' failure
- simplified some BTF.ext related endianness logic
- remove an 'inline' usage related to CI checkpatch failure
- improve some formatting noted by checkpatch warnings
- unexpected 'test_progs' failures drop
Fix missing newlines and extraneous terminal spaces in messages.
Signed-off-by: Tony Ambardar
---
tools/lib/bpf/btf.c | 6 +++---
tools/lib/bpf/btf_dump.c | 2 +-
tools/lib/bpf/btf_relocate.c | 2 +-
tools/lib/bpf/libbpf.c | 4 ++--
tools/lib/bpf/relo_core.c| 2 +-
5
Mention struct btf_ext_info_sec rather than non-existent btf_sec_func_info
in BTF.ext struct documentation.
Signed-off-by: Tony Ambardar
---
tools/lib/bpf/libbpf_internal.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/lib/bpf/libbpf_internal.h b/tools/lib/bpf
rectly translated.
Fixes: faf6ed321cf6 ("libbpf: Add BPF static linker APIs")
Signed-off-by: Tony Ambardar
---
tools/lib/bpf/linker.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/lib/bpf/linker.c b/tools/lib/bpf/linker.c
index 9cd3d4109788..7489306cd6f7 100644
--- a/tools/l
btf_ext__endianness() and btf_ext__set_endianness()
for query and setting byte-order, as already exist for BTF data.
[1] 3289959b97ca ("libbpf: Support BTF loading and raw data output in both
endianness")
[2] 8fd27bf69b86 ("libbpf: Add BPF static linker BTF and BTF.ext support")
Signed-o
Allow bpf_object__open() to access files of either endianness, and convert
included BPF programs to native byte-order in-memory for introspection.
Loading BPF objects of non-native byte-order is still disallowed however.
Signed-off-by: Tony Ambardar
---
tools/lib/bpf/libbpf.c | 52
. This
is enabled by built-in ELF translation and recent BTF/BTF.ext endianness
functions. Further add local functions for swapping byte-order of sections
containing BPF insns.
Signed-off-by: Tony Ambardar
---
tools/lib/bpf/linker.c | 78 +-
1 file changed
to target byte-order on
finalization. Add support functions to convert data to target endianness
as it is added to the blob.
Also add additional debug logging for data blob structure details and
skeleton loading.
Signed-off-by: Tony Ambardar
---
tools/lib/bpf/bpf_gen_internal.h | 1 +
too
Update Makefile build rules to compile BPF programs with target endianness
rather than host byte-order. With recent changes, this allows building the
full selftests/bpf suite hosted on x86_64 and targeting s390x or mips64eb
for example.
Signed-off-by: Tony Ambardar
---
tools/testing/selftests
On Tue, Sep 03, 2024 at 12:57:51PM -0700, Alexei Starovoitov wrote:
> On Tue, Sep 3, 2024 at 12:34 AM Tony Ambardar wrote:
> >
> > @@ -1040,10 +1121,11 @@ void bpf_gen__map_update_elem(struct bpf_gen *gen,
> > int map_idx, void *pvalue,
> > int zero = 0;
>
On Fri, Aug 30, 2024 at 05:15:06PM -0700, Eduard Zingerman wrote:
> On Fri, 2024-08-30 at 00:29 -0700, Tony Ambardar wrote:
>
> [...]
>
> > @@ -3050,11 +3127,42 @@ static int btf_ext_parse_hdr(__u8 *data, __u32
> > data_size)
> > return -ENOTS
On Wed, Sep 04, 2024 at 12:48:36PM -0700, Andrii Nakryiko wrote:
> On Tue, Sep 3, 2024 at 12:33 AM Tony Ambardar wrote:
> >
> > Support for handling BTF data of either endianness was added in [1], but
> > did not include BTF.ext data for lack of use cases. Later, support for
s logic
- remove an 'inline' usage related to CI checkpatch failure
- improve some formatting noted by checkpatch warnings
- unexpected 'test_progs' failures drop 3 -> 2 (x86_64 to s390x cross)
Tony Ambardar (8):
libbpf: Improve log message formatting
libbpf: Fix heade
Fix missing newlines and extraneous terminal spaces in messages.
Signed-off-by: Tony Ambardar
---
tools/lib/bpf/btf.c | 6 +++---
tools/lib/bpf/btf_dump.c | 2 +-
tools/lib/bpf/btf_relocate.c | 2 +-
tools/lib/bpf/libbpf.c | 4 ++--
tools/lib/bpf/relo_core.c| 2 +-
5
Mention struct btf_ext_info_sec rather than non-existent btf_sec_func_info
in BTF.ext struct documentation.
Signed-off-by: Tony Ambardar
---
tools/lib/bpf/libbpf_internal.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/lib/bpf/libbpf_internal.h b/tools/lib/bpf
rectly translated.
Fixes: faf6ed321cf6 ("libbpf: Add BPF static linker APIs")
Signed-off-by: Tony Ambardar
---
tools/lib/bpf/linker.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/lib/bpf/linker.c b/tools/lib/bpf/linker.c
index e0005c6ade88..6985ab0f1ca9 100644
--- a/tools/l
btf_ext__endianness() and btf_ext__set_endianness()
for query and setting byte-order, as already exist for BTF data.
[1] 3289959b97ca ("libbpf: Support BTF loading and raw data output in both
endianness")
[2] 8fd27bf69b86 ("libbpf: Add BPF static linker BTF and BTF.ext support")
Signed-o
Allow bpf_object__open() to access files of either endianness, and convert
included BPF programs to native byte-order in-memory for introspection.
Loading BPF objects of non-native byte-order is still disallowed however.
Signed-off-by: Tony Ambardar
---
tools/lib/bpf/libbpf.c | 51
. This
is enabled by built-in ELF translation and recent BTF/BTF.ext endianness
functions. Further add local functions for swapping byte-order of sections
containing BPF insns.
Signed-off-by: Tony Ambardar
---
tools/lib/bpf/linker.c | 78 +-
1 file changed
to target byte-order on
finalization. Add support functions to convert data to target endianness
as it is added to the blob.
Also add additional debug logging for data blob structure details and
skeleton loading.
Acked-by: Alexei Starovoitov
Signed-off-by: Tony Ambardar
---
too
Update Makefile build rules to compile BPF programs with target endianness
rather than host byte-order. With recent changes, this allows building the
full selftests/bpf suite hosted on x86_64 and targeting s390x or mips64eb
for example.
Acked-by: Yonghong Song
Signed-off-by: Tony Ambardar
LD), passed via
'-fuse-ld=' using an absolute path rather than a linker "flavour".
Fixes: 08c79c9cd67f ("selftests/bpf: Don't force lld on non-x86 architectures")
Signed-off-by: Tony Ambardar
---
tools/testing/selftests/bpf/Makefile | 2 +-
1 file change
ument to allow compiling for both musl and glibc.
Cc: Alexis Lothoré (eBPF Foundation)
Fixes: f957c230e173 ("selftests/bpf: convert test_skb_cgroup_id_user to
test_progs")
Signed-off-by: Tony Ambardar
---
tools/testing/selftests/bpf/prog_tests/cgroup_ancestor.c | 2 +-
1 file changed,
data is 4-byte aligned, and not only the
.BTF_ids used for vmlinux.
Patch #3 syncs the above changes in btf_ids.h to tools/include, obviating
a previous alignment fix in selftests/bpf.
Feedback and suggestions are welcome!
Best regards,
Tony
Tony Ambardar (3):
tools/resolve_btfids: Simplify
ot;)
CC: Viktor Malik
Signed-off-by: Tony Ambardar
---
tools/bpf/resolve_btfids/main.c | 60 -
1 file changed, 22 insertions(+), 38 deletions(-)
diff --git a/tools/bpf/resolve_btfids/main.c b/tools/bpf/resolve_btfids/main.c
index d54aaa0619df..9f1ab23ed014 100644
encoding macros in btf_ids.h to always align BTF ID data to 4 bytes.
[1]: 3effc06a4dde ("selftests/bpf: Fix alignment of .BTF_ids")
Signed-off-by: Tony Ambardar
---
include/linux/btf_ids.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/linux/btf_ids.h b/include/linux/btf_i
Update to include latest changes, including BTF_SET8 support and correct
alignment of .BTF_ids sections, and remove the now-redundant alignment fix
introduced in 3effc06a4dde ("selftests/bpf: Fix alignment of .BTF_ids").
CC: Jean-Philippe Brucker
Signed-off-by: Tony Ambardar
---
too
From: Tony Ambardar
The runqslower binary from a cross-endian build currently fails to run
because the included skeleton has host endianness. Fix this by passing the
target BPF endianness to the runqslower sub-make.
Fixes: 5a63c33d6f00 ("selftests/bpf: Support cross-endian building")
101 - 138 of 138 matches
Mail list logo