diff options
Diffstat (limited to 'samples')
| -rw-r--r-- | samples/bpf/Makefile | 1 | ||||
| -rw-r--r-- | samples/bpf/asm_goto_workaround.h | 16 | ||||
| -rw-r--r-- | samples/bpf/test_cgrp2_attach2.c | 14 | ||||
| -rw-r--r-- | samples/bpf/test_current_task_under_cgroup_user.c | 2 | ||||
| -rw-r--r-- | samples/bpf/xdp1_user.c | 2 | ||||
| -rw-r--r-- | samples/mei/mei-amt-version.c | 2 | ||||
| -rw-r--r-- | samples/seccomp/Makefile | 1 |
7 files changed, 28 insertions, 10 deletions
diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index 66ae15f27c70..db1a91dfa702 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile | |||
| @@ -279,6 +279,7 @@ $(obj)/%.o: $(src)/%.c | |||
| 279 | -Wno-gnu-variable-sized-type-not-at-end \ | 279 | -Wno-gnu-variable-sized-type-not-at-end \ |
| 280 | -Wno-address-of-packed-member -Wno-tautological-compare \ | 280 | -Wno-address-of-packed-member -Wno-tautological-compare \ |
| 281 | -Wno-unknown-warning-option $(CLANG_ARCH_ARGS) \ | 281 | -Wno-unknown-warning-option $(CLANG_ARCH_ARGS) \ |
| 282 | -I$(srctree)/samples/bpf/ -include asm_goto_workaround.h \ | ||
| 282 | -O2 -emit-llvm -c $< -o -| $(LLC) -march=bpf $(LLC_FLAGS) -filetype=obj -o $@ | 283 | -O2 -emit-llvm -c $< -o -| $(LLC) -march=bpf $(LLC_FLAGS) -filetype=obj -o $@ |
| 283 | ifeq ($(DWARF2BTF),y) | 284 | ifeq ($(DWARF2BTF),y) |
| 284 | $(BTF_PAHOLE) -J $@ | 285 | $(BTF_PAHOLE) -J $@ |
diff --git a/samples/bpf/asm_goto_workaround.h b/samples/bpf/asm_goto_workaround.h new file mode 100644 index 000000000000..5cd7c1d1a5d5 --- /dev/null +++ b/samples/bpf/asm_goto_workaround.h | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
| 2 | /* Copyright (c) 2019 Facebook */ | ||
| 3 | #ifndef __ASM_GOTO_WORKAROUND_H | ||
| 4 | #define __ASM_GOTO_WORKAROUND_H | ||
| 5 | |||
| 6 | /* this will bring in asm_volatile_goto macro definition | ||
| 7 | * if enabled by compiler and config options. | ||
| 8 | */ | ||
| 9 | #include <linux/types.h> | ||
| 10 | |||
| 11 | #ifdef asm_volatile_goto | ||
| 12 | #undef asm_volatile_goto | ||
| 13 | #define asm_volatile_goto(x...) asm volatile("invalid use of asm_volatile_goto") | ||
| 14 | #endif | ||
| 15 | |||
| 16 | #endif | ||
diff --git a/samples/bpf/test_cgrp2_attach2.c b/samples/bpf/test_cgrp2_attach2.c index d7b68ef5ba79..0bb6507256b7 100644 --- a/samples/bpf/test_cgrp2_attach2.c +++ b/samples/bpf/test_cgrp2_attach2.c | |||
| @@ -77,7 +77,7 @@ static int test_foo_bar(void) | |||
| 77 | 77 | ||
| 78 | /* Create cgroup /foo, get fd, and join it */ | 78 | /* Create cgroup /foo, get fd, and join it */ |
| 79 | foo = create_and_get_cgroup(FOO); | 79 | foo = create_and_get_cgroup(FOO); |
| 80 | if (!foo) | 80 | if (foo < 0) |
| 81 | goto err; | 81 | goto err; |
| 82 | 82 | ||
| 83 | if (join_cgroup(FOO)) | 83 | if (join_cgroup(FOO)) |
| @@ -94,7 +94,7 @@ static int test_foo_bar(void) | |||
| 94 | 94 | ||
| 95 | /* Create cgroup /foo/bar, get fd, and join it */ | 95 | /* Create cgroup /foo/bar, get fd, and join it */ |
| 96 | bar = create_and_get_cgroup(BAR); | 96 | bar = create_and_get_cgroup(BAR); |
| 97 | if (!bar) | 97 | if (bar < 0) |
| 98 | goto err; | 98 | goto err; |
| 99 | 99 | ||
| 100 | if (join_cgroup(BAR)) | 100 | if (join_cgroup(BAR)) |
| @@ -298,19 +298,19 @@ static int test_multiprog(void) | |||
| 298 | goto err; | 298 | goto err; |
| 299 | 299 | ||
| 300 | cg1 = create_and_get_cgroup("/cg1"); | 300 | cg1 = create_and_get_cgroup("/cg1"); |
| 301 | if (!cg1) | 301 | if (cg1 < 0) |
| 302 | goto err; | 302 | goto err; |
| 303 | cg2 = create_and_get_cgroup("/cg1/cg2"); | 303 | cg2 = create_and_get_cgroup("/cg1/cg2"); |
| 304 | if (!cg2) | 304 | if (cg2 < 0) |
| 305 | goto err; | 305 | goto err; |
| 306 | cg3 = create_and_get_cgroup("/cg1/cg2/cg3"); | 306 | cg3 = create_and_get_cgroup("/cg1/cg2/cg3"); |
| 307 | if (!cg3) | 307 | if (cg3 < 0) |
| 308 | goto err; | 308 | goto err; |
| 309 | cg4 = create_and_get_cgroup("/cg1/cg2/cg3/cg4"); | 309 | cg4 = create_and_get_cgroup("/cg1/cg2/cg3/cg4"); |
| 310 | if (!cg4) | 310 | if (cg4 < 0) |
| 311 | goto err; | 311 | goto err; |
| 312 | cg5 = create_and_get_cgroup("/cg1/cg2/cg3/cg4/cg5"); | 312 | cg5 = create_and_get_cgroup("/cg1/cg2/cg3/cg4/cg5"); |
| 313 | if (!cg5) | 313 | if (cg5 < 0) |
| 314 | goto err; | 314 | goto err; |
| 315 | 315 | ||
| 316 | if (join_cgroup("/cg1/cg2/cg3/cg4/cg5")) | 316 | if (join_cgroup("/cg1/cg2/cg3/cg4/cg5")) |
diff --git a/samples/bpf/test_current_task_under_cgroup_user.c b/samples/bpf/test_current_task_under_cgroup_user.c index 2259f997a26c..f082d6ac59f0 100644 --- a/samples/bpf/test_current_task_under_cgroup_user.c +++ b/samples/bpf/test_current_task_under_cgroup_user.c | |||
| @@ -32,7 +32,7 @@ int main(int argc, char **argv) | |||
| 32 | 32 | ||
| 33 | cg2 = create_and_get_cgroup(CGROUP_PATH); | 33 | cg2 = create_and_get_cgroup(CGROUP_PATH); |
| 34 | 34 | ||
| 35 | if (!cg2) | 35 | if (cg2 < 0) |
| 36 | goto err; | 36 | goto err; |
| 37 | 37 | ||
| 38 | if (bpf_map_update_elem(map_fd[0], &idx, &cg2, BPF_ANY)) { | 38 | if (bpf_map_update_elem(map_fd[0], &idx, &cg2, BPF_ANY)) { |
diff --git a/samples/bpf/xdp1_user.c b/samples/bpf/xdp1_user.c index 0a197f86ac43..8bfda95c77ad 100644 --- a/samples/bpf/xdp1_user.c +++ b/samples/bpf/xdp1_user.c | |||
| @@ -103,7 +103,7 @@ int main(int argc, char **argv) | |||
| 103 | return 1; | 103 | return 1; |
| 104 | } | 104 | } |
| 105 | 105 | ||
| 106 | ifindex = if_nametoindex(argv[1]); | 106 | ifindex = if_nametoindex(argv[optind]); |
| 107 | if (!ifindex) { | 107 | if (!ifindex) { |
| 108 | perror("if_nametoindex"); | 108 | perror("if_nametoindex"); |
| 109 | return 1; | 109 | return 1; |
diff --git a/samples/mei/mei-amt-version.c b/samples/mei/mei-amt-version.c index 33e67bd1dc34..32234481ad7d 100644 --- a/samples/mei/mei-amt-version.c +++ b/samples/mei/mei-amt-version.c | |||
| @@ -117,7 +117,7 @@ static bool mei_init(struct mei *me, const uuid_le *guid, | |||
| 117 | 117 | ||
| 118 | me->verbose = verbose; | 118 | me->verbose = verbose; |
| 119 | 119 | ||
| 120 | me->fd = open("/dev/mei", O_RDWR); | 120 | me->fd = open("/dev/mei0", O_RDWR); |
| 121 | if (me->fd == -1) { | 121 | if (me->fd == -1) { |
| 122 | mei_err(me, "Cannot establish a handle to the Intel MEI driver\n"); | 122 | mei_err(me, "Cannot establish a handle to the Intel MEI driver\n"); |
| 123 | goto err; | 123 | goto err; |
diff --git a/samples/seccomp/Makefile b/samples/seccomp/Makefile index 4920903c8009..fb43a814d4c0 100644 --- a/samples/seccomp/Makefile +++ b/samples/seccomp/Makefile | |||
| @@ -34,6 +34,7 @@ HOSTCFLAGS_bpf-direct.o += $(MFLAG) | |||
| 34 | HOSTCFLAGS_dropper.o += $(MFLAG) | 34 | HOSTCFLAGS_dropper.o += $(MFLAG) |
| 35 | HOSTCFLAGS_bpf-helper.o += $(MFLAG) | 35 | HOSTCFLAGS_bpf-helper.o += $(MFLAG) |
| 36 | HOSTCFLAGS_bpf-fancy.o += $(MFLAG) | 36 | HOSTCFLAGS_bpf-fancy.o += $(MFLAG) |
| 37 | HOSTCFLAGS_user-trap.o += $(MFLAG) | ||
| 37 | HOSTLDLIBS_bpf-direct += $(MFLAG) | 38 | HOSTLDLIBS_bpf-direct += $(MFLAG) |
| 38 | HOSTLDLIBS_bpf-fancy += $(MFLAG) | 39 | HOSTLDLIBS_bpf-fancy += $(MFLAG) |
| 39 | HOSTLDLIBS_dropper += $(MFLAG) | 40 | HOSTLDLIBS_dropper += $(MFLAG) |
