m68k: Wire up bpf
Subsystems (2)
Geert Uytterhoeven
maintainerPATCH 1/1 m68k: Wire up bpf
--- arch/m68k/include/asm/unistd.h | 2 +- arch/m68k/include/uapi/asm/unistd.h | 1 + arch/m68k/kernel/syscalltable.S | 1 + 3 files changed, 3 insertions(+), 1 deletion(-)
arch/m68k/include/asm/unistd.h +1 -1
@@ -4,7 +4,7 @@#include <uapi/asm/unistd.h> -#define NR_syscalls 354 +#define NR_syscalls 355#define __ARCH_WANT_OLD_READDIR#define __ARCH_WANT_OLD_STAT
arch/m68k/include/uapi/asm/unistd.h +1 -0
@@ -359,5 +359,6 @@#define __NR_renameat2 351#define __NR_getrandom 352#define __NR_memfd_create 353 +#define __NR_bpf 354#endif /* _UAPI_ASM_M68K_UNISTD_H_ */
arch/m68k/kernel/syscalltable.S +1 -0
@@ -374,4 +374,5 @@ ENTRY(sys_call_table) .long sys_renameat2 .long sys_getrandom .long sys_memfd_create + .long sys_bpf
Signature · 1 line
1.9.1
Quoted 6 lines · Geert Uytterhoeven
Signed-off-by Geert Uytterhoeven <[email protected]>--- arch/m68k/include/asm/unistd.h | 2 +- arch/m68k/include/uapi/asm/unistd.h | 1 + arch/m68k/kernel/syscalltable.S | 1 + 3 files changed, 3 insertions(+), 1 deletion(-)
did the tests pass in samples/bpf/test_verifier ?
Thank you for taking care of it.
Quoted 6 lines · Geert Uytterhoeven
Signed-off-by Geert Uytterhoeven <[email protected]>--- arch/m68k/include/asm/unistd.h | 2 +- arch/m68k/include/uapi/asm/unistd.h | 1 + arch/m68k/kernel/syscalltable.S | 1 + 3 files changed, 3 insertions(+), 1 deletion(-)
did the tests pass in samples/bpf/test_verifier ?
Thank you for taking care of it.
Geert Uytterhoeven
maintainerHi Alexei,
Quoted 10 lines · Alexei Starovoitov
Quoted 6 lines · Geert Uytterhoeven
Signed-off-by Geert Uytterhoeven <[email protected]>--- arch/m68k/include/asm/unistd.h | 2 +- arch/m68k/include/uapi/asm/unistd.h | 1 + arch/m68k/kernel/syscalltable.S | 1 + 3 files changed, 3 insertions(+), 1 deletion(-)did the tests pass in
samples/bpf/test_verifier?
Thanks for reminding me about the existence of the tests ;-)
Yes, they passed.
Note that gcc 4.1.2 doesn't like C99-initialization of anonymous struct and union members, so I had to use the patch below:
include/uapi/linux/bpf.h +3 -3
@@ -123,7 +123,7 @@ union bpf_attr {__u32 key_size;/* size of key in bytes */ __u32 value_size;/* size of value in bytes */ __u32 max_entries;/* max number of entries in a map */ - }; + } create;struct {/* anonymous struct used by BPF_MAP_*_ELEM commands */ __u32 map_fd;
@@ -132,7 +132,7 @@ union bpf_attr {__aligned_u64 value;__aligned_u64 next_key; }; - }; + } elem;struct {/* anonymous struct used by BPF_PROG_LOAD command */ __u32 prog_type;/* one of enum bpf_prog_type */
@@ -142,7 +142,7 @@ union bpf_attr {__u32 log_level;/* verbosity level of verifier */ __u32 log_size;/* size of user buffer */ __aligned_u64 log_buf;/* user supplied buffer */ - }; + } load; } __attribute__((aligned(8)));/* integer value in 'imm' field of BPF_CALL instruction selects which helper
samples/bpf/libbpf.c +22 -22
83 lines not on this page · raw message
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Alexei Starovoitov
Acked-byQuoted 12 lines · Geert Uytterhoeven
Hi Alexei,
Quoted 9 lines · Alexei Starovoitov
Quoted 6 lines · Geert Uytterhoeven
Signed-off-by Geert Uytterhoeven <[email protected]>--- arch/m68k/include/asm/unistd.h | 2 +- arch/m68k/include/uapi/asm/unistd.h | 1 + arch/m68k/kernel/syscalltable.S | 1 + 3 files changed, 3 insertions(+), 1 deletion(-)
Quoted 5 lines
Quoted 1 line
did the tests pass in
samples/bpf/test_verifier?Thanks for reminding me about the existence of the tests ;-)
Yes, they passed.
Great, then:
include/uapi/linux/bpf.h union bpf_attr { · line 126
Quoted 13 lines
Note that gcc 4.1.2 doesn't like C99-initialization of anonymous struct and union members, so I had to use the patch below:
include/uapi/linux/bpf.h +1
-1@@ -123,7 +123,7 @@ union bpf_attr {__u32 key_size;/* size of key in bytes */ __u32 value_size;/* size of value in bytes */ __u32 max_entries;/* max number of entries in a map */ - }; + } create;
I've tested this stuff with 4.2 and up, since that's the oldest we have in kernel.org cross-compilers repo.
4.1 was a first release with brand new C front-end which had all sorts of gotchas and just like 4.0 was a massive release too. Nowadays I wouldn't touch anything below 4.4
Alexei Starovoitov
Acked-byQuoted 12 lines · Geert Uytterhoeven
Hi Alexei,
Quoted 9 lines · Alexei Starovoitov
Quoted 6 lines · Geert Uytterhoeven
Signed-off-by Geert Uytterhoeven <[email protected]>--- arch/m68k/include/asm/unistd.h | 2 +- arch/m68k/include/uapi/asm/unistd.h | 1 + arch/m68k/kernel/syscalltable.S | 1 + 3 files changed, 3 insertions(+), 1 deletion(-)
Quoted 5 lines
Quoted 1 line
did the tests pass in
samples/bpf/test_verifier?Thanks for reminding me about the existence of the tests ;-)
Yes, they passed.
Great, then:
include/uapi/linux/bpf.h union bpf_attr { · line 126
Quoted 13 lines
Note that gcc 4.1.2 doesn't like C99-initialization of anonymous struct and union members, so I had to use the patch below:
include/uapi/linux/bpf.h +1
-1@@ -123,7 +123,7 @@ union bpf_attr {__u32 key_size;/* size of key in bytes */ __u32 value_size;/* size of value in bytes */ __u32 max_entries;/* max number of entries in a map */ - }; + } create;
I've tested this stuff with 4.2 and up, since that's the oldest we have in kernel.org cross-compilers repo.
4.1 was a first release with brand new C front-end which had all sorts of gotchas and just like 4.0 was a massive release too. Nowadays I wouldn't touch anything below 4.4