diff options
author | Ilya Leoshkevich <iii@linux.ibm.com> | 2023-01-28 01:06:43 +0100 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2023-01-28 12:45:15 -0800 |
commit | 0f0e5f5bd5066c9ffaa006e26fc7d092b04d4088 (patch) | |
tree | 7a914f3619b1294282c7c09947eb2e9ca578f2a7 /kernel/bpf/preload/bpf_preload_kern.c | |
parent | 42fae973c2b168d527c8b4f6a02828ecd1e19626 (diff) |
bpf: iterators: Split iterators.lskel.h into little- and big- endian versions
iterators.lskel.h is little-endian, therefore bpf iterator is currently
broken on big-endian systems. Introduce a big-endian version and add
instructions regarding its generation. Unfortunately bpftool's
cross-endianness capabilities are limited to BTF right now, so the
procedure requires access to a big-endian machine or a configured
emulator.
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Link: https://lore.kernel.org/r/20230128000650.1516334-25-iii@linux.ibm.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'kernel/bpf/preload/bpf_preload_kern.c')
-rw-r--r-- | kernel/bpf/preload/bpf_preload_kern.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/bpf/preload/bpf_preload_kern.c b/kernel/bpf/preload/bpf_preload_kern.c index 5106b5372f0c..b56f9f3314fd 100644 --- a/kernel/bpf/preload/bpf_preload_kern.c +++ b/kernel/bpf/preload/bpf_preload_kern.c @@ -3,7 +3,11 @@ #include <linux/init.h> #include <linux/module.h> #include "bpf_preload.h" -#include "iterators/iterators.lskel.h" +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ +#include "iterators/iterators.lskel-little-endian.h" +#else +#include "iterators/iterators.lskel-big-endian.h" +#endif static struct bpf_link *maps_link, *progs_link; static struct iterators_bpf *skel; |