diff options
author | David S. Miller <davem@davemloft.net> | 2018-08-05 16:04:31 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-08-05 16:04:31 -0400 |
commit | c1c8626fcebed467184ffd8de0ab5c9f9d9c3594 (patch) | |
tree | 2c661fee934f4a7985e4f8e29cd1ba63a330a5e4 /tools | |
parent | d89d41556141a527030a15233135ba622ba3350d (diff) | |
parent | 1ffaddd029c867d134a1dde39f540dcc8c52e274 (diff) |
Merge ra.kernel.org:/pub/scm/linux/kernel/git/davem/net
Lots of overlapping changes, mostly trivial in nature.
The mlxsw conflict was resolving using the example
resolution at:
https://github.com/jpirko/linux_mlxsw/blob/combined_queue/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.c
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/arch/powerpc/include/uapi/asm/unistd.h | 1 | ||||
-rw-r--r-- | tools/arch/x86/include/asm/mcsafe_test.h | 13 | ||||
-rw-r--r-- | tools/arch/x86/lib/memcpy_64.S | 112 | ||||
-rw-r--r-- | tools/bpf/bpftool/map.c | 14 | ||||
-rw-r--r-- | tools/include/uapi/linux/perf_event.h | 2 | ||||
-rw-r--r-- | tools/perf/arch/x86/util/pmu.c | 1 | ||||
-rw-r--r-- | tools/perf/arch/x86/util/tsc.c | 1 | ||||
-rw-r--r-- | tools/perf/bench/Build | 1 | ||||
-rw-r--r-- | tools/perf/bench/mem-memcpy-x86-64-asm.S | 1 | ||||
-rw-r--r-- | tools/perf/bench/mem-memcpy-x86-64-lib.c | 24 | ||||
-rw-r--r-- | tools/perf/perf.h | 1 | ||||
-rw-r--r-- | tools/perf/util/header.h | 1 | ||||
-rw-r--r-- | tools/perf/util/namespaces.h | 1 | ||||
-rwxr-xr-x | tools/testing/selftests/bpf/test_lwt_seg6local.sh | 6 | ||||
-rw-r--r-- | tools/testing/selftests/net/tcp_mmap.c | 2 |
15 files changed, 114 insertions, 67 deletions
diff --git a/tools/arch/powerpc/include/uapi/asm/unistd.h b/tools/arch/powerpc/include/uapi/asm/unistd.h index ac5ba55066dd..985534d0b448 100644 --- a/tools/arch/powerpc/include/uapi/asm/unistd.h +++ b/tools/arch/powerpc/include/uapi/asm/unistd.h | |||
@@ -399,5 +399,6 @@ | |||
399 | #define __NR_pkey_free 385 | 399 | #define __NR_pkey_free 385 |
400 | #define __NR_pkey_mprotect 386 | 400 | #define __NR_pkey_mprotect 386 |
401 | #define __NR_rseq 387 | 401 | #define __NR_rseq 387 |
402 | #define __NR_io_pgetevents 388 | ||
402 | 403 | ||
403 | #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */ | 404 | #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */ |
diff --git a/tools/arch/x86/include/asm/mcsafe_test.h b/tools/arch/x86/include/asm/mcsafe_test.h new file mode 100644 index 000000000000..2ccd588fbad4 --- /dev/null +++ b/tools/arch/x86/include/asm/mcsafe_test.h | |||
@@ -0,0 +1,13 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
2 | #ifndef _MCSAFE_TEST_H_ | ||
3 | #define _MCSAFE_TEST_H_ | ||
4 | |||
5 | .macro MCSAFE_TEST_CTL | ||
6 | .endm | ||
7 | |||
8 | .macro MCSAFE_TEST_SRC reg count target | ||
9 | .endm | ||
10 | |||
11 | .macro MCSAFE_TEST_DST reg count target | ||
12 | .endm | ||
13 | #endif /* _MCSAFE_TEST_H_ */ | ||
diff --git a/tools/arch/x86/lib/memcpy_64.S b/tools/arch/x86/lib/memcpy_64.S index 9a53a06e5a3e..298ef1479240 100644 --- a/tools/arch/x86/lib/memcpy_64.S +++ b/tools/arch/x86/lib/memcpy_64.S | |||
@@ -3,6 +3,7 @@ | |||
3 | #include <linux/linkage.h> | 3 | #include <linux/linkage.h> |
4 | #include <asm/errno.h> | 4 | #include <asm/errno.h> |
5 | #include <asm/cpufeatures.h> | 5 | #include <asm/cpufeatures.h> |
6 | #include <asm/mcsafe_test.h> | ||
6 | #include <asm/alternative-asm.h> | 7 | #include <asm/alternative-asm.h> |
7 | #include <asm/export.h> | 8 | #include <asm/export.h> |
8 | 9 | ||
@@ -183,12 +184,15 @@ ENTRY(memcpy_orig) | |||
183 | ENDPROC(memcpy_orig) | 184 | ENDPROC(memcpy_orig) |
184 | 185 | ||
185 | #ifndef CONFIG_UML | 186 | #ifndef CONFIG_UML |
187 | |||
188 | MCSAFE_TEST_CTL | ||
189 | |||
186 | /* | 190 | /* |
187 | * memcpy_mcsafe_unrolled - memory copy with machine check exception handling | 191 | * __memcpy_mcsafe - memory copy with machine check exception handling |
188 | * Note that we only catch machine checks when reading the source addresses. | 192 | * Note that we only catch machine checks when reading the source addresses. |
189 | * Writes to target are posted and don't generate machine checks. | 193 | * Writes to target are posted and don't generate machine checks. |
190 | */ | 194 | */ |
191 | ENTRY(memcpy_mcsafe_unrolled) | 195 | ENTRY(__memcpy_mcsafe) |
192 | cmpl $8, %edx | 196 | cmpl $8, %edx |
193 | /* Less than 8 bytes? Go to byte copy loop */ | 197 | /* Less than 8 bytes? Go to byte copy loop */ |
194 | jb .L_no_whole_words | 198 | jb .L_no_whole_words |
@@ -204,58 +208,33 @@ ENTRY(memcpy_mcsafe_unrolled) | |||
204 | subl $8, %ecx | 208 | subl $8, %ecx |
205 | negl %ecx | 209 | negl %ecx |
206 | subl %ecx, %edx | 210 | subl %ecx, %edx |
207 | .L_copy_leading_bytes: | 211 | .L_read_leading_bytes: |
208 | movb (%rsi), %al | 212 | movb (%rsi), %al |
213 | MCSAFE_TEST_SRC %rsi 1 .E_leading_bytes | ||
214 | MCSAFE_TEST_DST %rdi 1 .E_leading_bytes | ||
215 | .L_write_leading_bytes: | ||
209 | movb %al, (%rdi) | 216 | movb %al, (%rdi) |
210 | incq %rsi | 217 | incq %rsi |
211 | incq %rdi | 218 | incq %rdi |
212 | decl %ecx | 219 | decl %ecx |
213 | jnz .L_copy_leading_bytes | 220 | jnz .L_read_leading_bytes |
214 | 221 | ||
215 | .L_8byte_aligned: | 222 | .L_8byte_aligned: |
216 | /* Figure out how many whole cache lines (64-bytes) to copy */ | ||
217 | movl %edx, %ecx | ||
218 | andl $63, %edx | ||
219 | shrl $6, %ecx | ||
220 | jz .L_no_whole_cache_lines | ||
221 | |||
222 | /* Loop copying whole cache lines */ | ||
223 | .L_cache_w0: movq (%rsi), %r8 | ||
224 | .L_cache_w1: movq 1*8(%rsi), %r9 | ||
225 | .L_cache_w2: movq 2*8(%rsi), %r10 | ||
226 | .L_cache_w3: movq 3*8(%rsi), %r11 | ||
227 | movq %r8, (%rdi) | ||
228 | movq %r9, 1*8(%rdi) | ||
229 | movq %r10, 2*8(%rdi) | ||
230 | movq %r11, 3*8(%rdi) | ||
231 | .L_cache_w4: movq 4*8(%rsi), %r8 | ||
232 | .L_cache_w5: movq 5*8(%rsi), %r9 | ||
233 | .L_cache_w6: movq 6*8(%rsi), %r10 | ||
234 | .L_cache_w7: movq 7*8(%rsi), %r11 | ||
235 | movq %r8, 4*8(%rdi) | ||
236 | movq %r9, 5*8(%rdi) | ||
237 | movq %r10, 6*8(%rdi) | ||
238 | movq %r11, 7*8(%rdi) | ||
239 | leaq 64(%rsi), %rsi | ||
240 | leaq 64(%rdi), %rdi | ||
241 | decl %ecx | ||
242 | jnz .L_cache_w0 | ||
243 | |||
244 | /* Are there any trailing 8-byte words? */ | ||
245 | .L_no_whole_cache_lines: | ||
246 | movl %edx, %ecx | 223 | movl %edx, %ecx |
247 | andl $7, %edx | 224 | andl $7, %edx |
248 | shrl $3, %ecx | 225 | shrl $3, %ecx |
249 | jz .L_no_whole_words | 226 | jz .L_no_whole_words |
250 | 227 | ||
251 | /* Copy trailing words */ | 228 | .L_read_words: |
252 | .L_copy_trailing_words: | ||
253 | movq (%rsi), %r8 | 229 | movq (%rsi), %r8 |
254 | mov %r8, (%rdi) | 230 | MCSAFE_TEST_SRC %rsi 8 .E_read_words |
255 | leaq 8(%rsi), %rsi | 231 | MCSAFE_TEST_DST %rdi 8 .E_write_words |
256 | leaq 8(%rdi), %rdi | 232 | .L_write_words: |
233 | movq %r8, (%rdi) | ||
234 | addq $8, %rsi | ||
235 | addq $8, %rdi | ||
257 | decl %ecx | 236 | decl %ecx |
258 | jnz .L_copy_trailing_words | 237 | jnz .L_read_words |
259 | 238 | ||
260 | /* Any trailing bytes? */ | 239 | /* Any trailing bytes? */ |
261 | .L_no_whole_words: | 240 | .L_no_whole_words: |
@@ -264,38 +243,55 @@ ENTRY(memcpy_mcsafe_unrolled) | |||
264 | 243 | ||
265 | /* Copy trailing bytes */ | 244 | /* Copy trailing bytes */ |
266 | movl %edx, %ecx | 245 | movl %edx, %ecx |
267 | .L_copy_trailing_bytes: | 246 | .L_read_trailing_bytes: |
268 | movb (%rsi), %al | 247 | movb (%rsi), %al |
248 | MCSAFE_TEST_SRC %rsi 1 .E_trailing_bytes | ||
249 | MCSAFE_TEST_DST %rdi 1 .E_trailing_bytes | ||
250 | .L_write_trailing_bytes: | ||
269 | movb %al, (%rdi) | 251 | movb %al, (%rdi) |
270 | incq %rsi | 252 | incq %rsi |
271 | incq %rdi | 253 | incq %rdi |
272 | decl %ecx | 254 | decl %ecx |
273 | jnz .L_copy_trailing_bytes | 255 | jnz .L_read_trailing_bytes |
274 | 256 | ||
275 | /* Copy successful. Return zero */ | 257 | /* Copy successful. Return zero */ |
276 | .L_done_memcpy_trap: | 258 | .L_done_memcpy_trap: |
277 | xorq %rax, %rax | 259 | xorq %rax, %rax |
278 | ret | 260 | ret |
279 | ENDPROC(memcpy_mcsafe_unrolled) | 261 | ENDPROC(__memcpy_mcsafe) |
280 | EXPORT_SYMBOL_GPL(memcpy_mcsafe_unrolled) | 262 | EXPORT_SYMBOL_GPL(__memcpy_mcsafe) |
281 | 263 | ||
282 | .section .fixup, "ax" | 264 | .section .fixup, "ax" |
283 | /* Return -EFAULT for any failure */ | 265 | /* |
284 | .L_memcpy_mcsafe_fail: | 266 | * Return number of bytes not copied for any failure. Note that |
285 | mov $-EFAULT, %rax | 267 | * there is no "tail" handling since the source buffer is 8-byte |
268 | * aligned and poison is cacheline aligned. | ||
269 | */ | ||
270 | .E_read_words: | ||
271 | shll $3, %ecx | ||
272 | .E_leading_bytes: | ||
273 | addl %edx, %ecx | ||
274 | .E_trailing_bytes: | ||
275 | mov %ecx, %eax | ||
286 | ret | 276 | ret |
287 | 277 | ||
278 | /* | ||
279 | * For write fault handling, given the destination is unaligned, | ||
280 | * we handle faults on multi-byte writes with a byte-by-byte | ||
281 | * copy up to the write-protected page. | ||
282 | */ | ||
283 | .E_write_words: | ||
284 | shll $3, %ecx | ||
285 | addl %edx, %ecx | ||
286 | movl %ecx, %edx | ||
287 | jmp mcsafe_handle_tail | ||
288 | |||
288 | .previous | 289 | .previous |
289 | 290 | ||
290 | _ASM_EXTABLE_FAULT(.L_copy_leading_bytes, .L_memcpy_mcsafe_fail) | 291 | _ASM_EXTABLE_FAULT(.L_read_leading_bytes, .E_leading_bytes) |
291 | _ASM_EXTABLE_FAULT(.L_cache_w0, .L_memcpy_mcsafe_fail) | 292 | _ASM_EXTABLE_FAULT(.L_read_words, .E_read_words) |
292 | _ASM_EXTABLE_FAULT(.L_cache_w1, .L_memcpy_mcsafe_fail) | 293 | _ASM_EXTABLE_FAULT(.L_read_trailing_bytes, .E_trailing_bytes) |
293 | _ASM_EXTABLE_FAULT(.L_cache_w2, .L_memcpy_mcsafe_fail) | 294 | _ASM_EXTABLE(.L_write_leading_bytes, .E_leading_bytes) |
294 | _ASM_EXTABLE_FAULT(.L_cache_w3, .L_memcpy_mcsafe_fail) | 295 | _ASM_EXTABLE(.L_write_words, .E_write_words) |
295 | _ASM_EXTABLE_FAULT(.L_cache_w4, .L_memcpy_mcsafe_fail) | 296 | _ASM_EXTABLE(.L_write_trailing_bytes, .E_trailing_bytes) |
296 | _ASM_EXTABLE_FAULT(.L_cache_w5, .L_memcpy_mcsafe_fail) | ||
297 | _ASM_EXTABLE_FAULT(.L_cache_w6, .L_memcpy_mcsafe_fail) | ||
298 | _ASM_EXTABLE_FAULT(.L_cache_w7, .L_memcpy_mcsafe_fail) | ||
299 | _ASM_EXTABLE_FAULT(.L_copy_trailing_words, .L_memcpy_mcsafe_fail) | ||
300 | _ASM_EXTABLE_FAULT(.L_copy_trailing_bytes, .L_memcpy_mcsafe_fail) | ||
301 | #endif | 297 | #endif |
diff --git a/tools/bpf/bpftool/map.c b/tools/bpf/bpftool/map.c index 9c8191845585..e860ca859b28 100644 --- a/tools/bpf/bpftool/map.c +++ b/tools/bpf/bpftool/map.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <errno.h> | 35 | #include <errno.h> |
36 | #include <fcntl.h> | 36 | #include <fcntl.h> |
37 | #include <linux/err.h> | 37 | #include <linux/err.h> |
38 | #include <linux/kernel.h> | ||
38 | #include <stdbool.h> | 39 | #include <stdbool.h> |
39 | #include <stdio.h> | 40 | #include <stdio.h> |
40 | #include <stdlib.h> | 41 | #include <stdlib.h> |
@@ -91,7 +92,8 @@ static bool map_is_map_of_progs(__u32 type) | |||
91 | static void *alloc_value(struct bpf_map_info *info) | 92 | static void *alloc_value(struct bpf_map_info *info) |
92 | { | 93 | { |
93 | if (map_is_per_cpu(info->type)) | 94 | if (map_is_per_cpu(info->type)) |
94 | return malloc(info->value_size * get_possible_cpus()); | 95 | return malloc(round_up(info->value_size, 8) * |
96 | get_possible_cpus()); | ||
95 | else | 97 | else |
96 | return malloc(info->value_size); | 98 | return malloc(info->value_size); |
97 | } | 99 | } |
@@ -273,9 +275,10 @@ static void print_entry_json(struct bpf_map_info *info, unsigned char *key, | |||
273 | do_dump_btf(&d, info, key, value); | 275 | do_dump_btf(&d, info, key, value); |
274 | } | 276 | } |
275 | } else { | 277 | } else { |
276 | unsigned int i, n; | 278 | unsigned int i, n, step; |
277 | 279 | ||
278 | n = get_possible_cpus(); | 280 | n = get_possible_cpus(); |
281 | step = round_up(info->value_size, 8); | ||
279 | 282 | ||
280 | jsonw_name(json_wtr, "key"); | 283 | jsonw_name(json_wtr, "key"); |
281 | print_hex_data_json(key, info->key_size); | 284 | print_hex_data_json(key, info->key_size); |
@@ -288,7 +291,7 @@ static void print_entry_json(struct bpf_map_info *info, unsigned char *key, | |||
288 | jsonw_int_field(json_wtr, "cpu", i); | 291 | jsonw_int_field(json_wtr, "cpu", i); |
289 | 292 | ||
290 | jsonw_name(json_wtr, "value"); | 293 | jsonw_name(json_wtr, "value"); |
291 | print_hex_data_json(value + i * info->value_size, | 294 | print_hex_data_json(value + i * step, |
292 | info->value_size); | 295 | info->value_size); |
293 | 296 | ||
294 | jsonw_end_object(json_wtr); | 297 | jsonw_end_object(json_wtr); |
@@ -319,9 +322,10 @@ static void print_entry_plain(struct bpf_map_info *info, unsigned char *key, | |||
319 | 322 | ||
320 | printf("\n"); | 323 | printf("\n"); |
321 | } else { | 324 | } else { |
322 | unsigned int i, n; | 325 | unsigned int i, n, step; |
323 | 326 | ||
324 | n = get_possible_cpus(); | 327 | n = get_possible_cpus(); |
328 | step = round_up(info->value_size, 8); | ||
325 | 329 | ||
326 | printf("key:\n"); | 330 | printf("key:\n"); |
327 | fprint_hex(stdout, key, info->key_size, " "); | 331 | fprint_hex(stdout, key, info->key_size, " "); |
@@ -329,7 +333,7 @@ static void print_entry_plain(struct bpf_map_info *info, unsigned char *key, | |||
329 | for (i = 0; i < n; i++) { | 333 | for (i = 0; i < n; i++) { |
330 | printf("value (CPU %02d):%c", | 334 | printf("value (CPU %02d):%c", |
331 | i, info->value_size > 16 ? '\n' : ' '); | 335 | i, info->value_size > 16 ? '\n' : ' '); |
332 | fprint_hex(stdout, value + i * info->value_size, | 336 | fprint_hex(stdout, value + i * step, |
333 | info->value_size, " "); | 337 | info->value_size, " "); |
334 | printf("\n"); | 338 | printf("\n"); |
335 | } | 339 | } |
diff --git a/tools/include/uapi/linux/perf_event.h b/tools/include/uapi/linux/perf_event.h index b8e288a1f740..eeb787b1c53c 100644 --- a/tools/include/uapi/linux/perf_event.h +++ b/tools/include/uapi/linux/perf_event.h | |||
@@ -143,6 +143,8 @@ enum perf_event_sample_format { | |||
143 | PERF_SAMPLE_PHYS_ADDR = 1U << 19, | 143 | PERF_SAMPLE_PHYS_ADDR = 1U << 19, |
144 | 144 | ||
145 | PERF_SAMPLE_MAX = 1U << 20, /* non-ABI */ | 145 | PERF_SAMPLE_MAX = 1U << 20, /* non-ABI */ |
146 | |||
147 | __PERF_SAMPLE_CALLCHAIN_EARLY = 1ULL << 63, | ||
146 | }; | 148 | }; |
147 | 149 | ||
148 | /* | 150 | /* |
diff --git a/tools/perf/arch/x86/util/pmu.c b/tools/perf/arch/x86/util/pmu.c index 63a74c32ddc5..e33ef5bc31c5 100644 --- a/tools/perf/arch/x86/util/pmu.c +++ b/tools/perf/arch/x86/util/pmu.c | |||
@@ -1,6 +1,7 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
2 | #include <string.h> | 2 | #include <string.h> |
3 | 3 | ||
4 | #include <linux/stddef.h> | ||
4 | #include <linux/perf_event.h> | 5 | #include <linux/perf_event.h> |
5 | 6 | ||
6 | #include "../../util/intel-pt.h" | 7 | #include "../../util/intel-pt.h" |
diff --git a/tools/perf/arch/x86/util/tsc.c b/tools/perf/arch/x86/util/tsc.c index 06bae7023a51..950539f9a4f7 100644 --- a/tools/perf/arch/x86/util/tsc.c +++ b/tools/perf/arch/x86/util/tsc.c | |||
@@ -2,6 +2,7 @@ | |||
2 | #include <stdbool.h> | 2 | #include <stdbool.h> |
3 | #include <errno.h> | 3 | #include <errno.h> |
4 | 4 | ||
5 | #include <linux/stddef.h> | ||
5 | #include <linux/perf_event.h> | 6 | #include <linux/perf_event.h> |
6 | 7 | ||
7 | #include "../../perf.h" | 8 | #include "../../perf.h" |
diff --git a/tools/perf/bench/Build b/tools/perf/bench/Build index 60bf11943047..eafce1a130a1 100644 --- a/tools/perf/bench/Build +++ b/tools/perf/bench/Build | |||
@@ -7,6 +7,7 @@ perf-y += futex-wake-parallel.o | |||
7 | perf-y += futex-requeue.o | 7 | perf-y += futex-requeue.o |
8 | perf-y += futex-lock-pi.o | 8 | perf-y += futex-lock-pi.o |
9 | 9 | ||
10 | perf-$(CONFIG_X86_64) += mem-memcpy-x86-64-lib.o | ||
10 | perf-$(CONFIG_X86_64) += mem-memcpy-x86-64-asm.o | 11 | perf-$(CONFIG_X86_64) += mem-memcpy-x86-64-asm.o |
11 | perf-$(CONFIG_X86_64) += mem-memset-x86-64-asm.o | 12 | perf-$(CONFIG_X86_64) += mem-memset-x86-64-asm.o |
12 | 13 | ||
diff --git a/tools/perf/bench/mem-memcpy-x86-64-asm.S b/tools/perf/bench/mem-memcpy-x86-64-asm.S index b43f8d2a34ec..9ad015a1e202 100644 --- a/tools/perf/bench/mem-memcpy-x86-64-asm.S +++ b/tools/perf/bench/mem-memcpy-x86-64-asm.S | |||
@@ -6,6 +6,7 @@ | |||
6 | #define altinstr_replacement text | 6 | #define altinstr_replacement text |
7 | #define globl p2align 4; .globl | 7 | #define globl p2align 4; .globl |
8 | #define _ASM_EXTABLE_FAULT(x, y) | 8 | #define _ASM_EXTABLE_FAULT(x, y) |
9 | #define _ASM_EXTABLE(x, y) | ||
9 | 10 | ||
10 | #include "../../arch/x86/lib/memcpy_64.S" | 11 | #include "../../arch/x86/lib/memcpy_64.S" |
11 | /* | 12 | /* |
diff --git a/tools/perf/bench/mem-memcpy-x86-64-lib.c b/tools/perf/bench/mem-memcpy-x86-64-lib.c new file mode 100644 index 000000000000..4130734dde84 --- /dev/null +++ b/tools/perf/bench/mem-memcpy-x86-64-lib.c | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * From code in arch/x86/lib/usercopy_64.c, copied to keep tools/ copy | ||
3 | * of the kernel's arch/x86/lib/memcpy_64.s used in 'perf bench mem memcpy' | ||
4 | * happy. | ||
5 | */ | ||
6 | #include <linux/types.h> | ||
7 | |||
8 | unsigned long __memcpy_mcsafe(void *dst, const void *src, size_t cnt); | ||
9 | unsigned long mcsafe_handle_tail(char *to, char *from, unsigned len); | ||
10 | |||
11 | unsigned long mcsafe_handle_tail(char *to, char *from, unsigned len) | ||
12 | { | ||
13 | for (; len; --len, to++, from++) { | ||
14 | /* | ||
15 | * Call the assembly routine back directly since | ||
16 | * memcpy_mcsafe() may silently fallback to memcpy. | ||
17 | */ | ||
18 | unsigned long rem = __memcpy_mcsafe(to, from, 1); | ||
19 | |||
20 | if (rem) | ||
21 | break; | ||
22 | } | ||
23 | return len; | ||
24 | } | ||
diff --git a/tools/perf/perf.h b/tools/perf/perf.h index a1a97956136f..d215714f48df 100644 --- a/tools/perf/perf.h +++ b/tools/perf/perf.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <time.h> | 5 | #include <time.h> |
6 | #include <stdbool.h> | 6 | #include <stdbool.h> |
7 | #include <linux/types.h> | 7 | #include <linux/types.h> |
8 | #include <linux/stddef.h> | ||
8 | #include <linux/perf_event.h> | 9 | #include <linux/perf_event.h> |
9 | 10 | ||
10 | extern bool test_attr__enabled; | 11 | extern bool test_attr__enabled; |
diff --git a/tools/perf/util/header.h b/tools/perf/util/header.h index 90d4577a92dc..6d7fe44aadc0 100644 --- a/tools/perf/util/header.h +++ b/tools/perf/util/header.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #ifndef __PERF_HEADER_H | 2 | #ifndef __PERF_HEADER_H |
3 | #define __PERF_HEADER_H | 3 | #define __PERF_HEADER_H |
4 | 4 | ||
5 | #include <linux/stddef.h> | ||
5 | #include <linux/perf_event.h> | 6 | #include <linux/perf_event.h> |
6 | #include <sys/types.h> | 7 | #include <sys/types.h> |
7 | #include <stdbool.h> | 8 | #include <stdbool.h> |
diff --git a/tools/perf/util/namespaces.h b/tools/perf/util/namespaces.h index 760558dcfd18..cae1a9a39722 100644 --- a/tools/perf/util/namespaces.h +++ b/tools/perf/util/namespaces.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #define __PERF_NAMESPACES_H | 10 | #define __PERF_NAMESPACES_H |
11 | 11 | ||
12 | #include <sys/types.h> | 12 | #include <sys/types.h> |
13 | #include <linux/stddef.h> | ||
13 | #include <linux/perf_event.h> | 14 | #include <linux/perf_event.h> |
14 | #include <linux/refcount.h> | 15 | #include <linux/refcount.h> |
15 | #include <linux/types.h> | 16 | #include <linux/types.h> |
diff --git a/tools/testing/selftests/bpf/test_lwt_seg6local.sh b/tools/testing/selftests/bpf/test_lwt_seg6local.sh index 270fa8f49573..785eabf2a593 100755 --- a/tools/testing/selftests/bpf/test_lwt_seg6local.sh +++ b/tools/testing/selftests/bpf/test_lwt_seg6local.sh | |||
@@ -115,14 +115,14 @@ ip netns exec ns2 ip -6 route add fb00::6 encap bpf in obj test_lwt_seg6local.o | |||
115 | ip netns exec ns2 ip -6 route add fd00::1 dev veth3 via fb00::43 scope link | 115 | ip netns exec ns2 ip -6 route add fd00::1 dev veth3 via fb00::43 scope link |
116 | 116 | ||
117 | ip netns exec ns3 ip -6 route add fc42::1 dev veth5 via fb00::65 | 117 | ip netns exec ns3 ip -6 route add fc42::1 dev veth5 via fb00::65 |
118 | ip netns exec ns3 ip -6 route add fd00::1 encap seg6local action End.BPF obj test_lwt_seg6local.o sec add_egr_x dev veth4 | 118 | ip netns exec ns3 ip -6 route add fd00::1 encap seg6local action End.BPF endpoint obj test_lwt_seg6local.o sec add_egr_x dev veth4 |
119 | 119 | ||
120 | ip netns exec ns4 ip -6 route add fd00::2 encap seg6local action End.BPF obj test_lwt_seg6local.o sec pop_egr dev veth6 | 120 | ip netns exec ns4 ip -6 route add fd00::2 encap seg6local action End.BPF endpoint obj test_lwt_seg6local.o sec pop_egr dev veth6 |
121 | ip netns exec ns4 ip -6 addr add fc42::1 dev lo | 121 | ip netns exec ns4 ip -6 addr add fc42::1 dev lo |
122 | ip netns exec ns4 ip -6 route add fd00::3 dev veth7 via fb00::87 | 122 | ip netns exec ns4 ip -6 route add fd00::3 dev veth7 via fb00::87 |
123 | 123 | ||
124 | ip netns exec ns5 ip -6 route add fd00::4 table 117 dev veth9 via fb00::109 | 124 | ip netns exec ns5 ip -6 route add fd00::4 table 117 dev veth9 via fb00::109 |
125 | ip netns exec ns5 ip -6 route add fd00::3 encap seg6local action End.BPF obj test_lwt_seg6local.o sec inspect_t dev veth8 | 125 | ip netns exec ns5 ip -6 route add fd00::3 encap seg6local action End.BPF endpoint obj test_lwt_seg6local.o sec inspect_t dev veth8 |
126 | 126 | ||
127 | ip netns exec ns6 ip -6 addr add fb00::6/16 dev lo | 127 | ip netns exec ns6 ip -6 addr add fb00::6/16 dev lo |
128 | ip netns exec ns6 ip -6 addr add fd00::4/16 dev lo | 128 | ip netns exec ns6 ip -6 addr add fd00::4/16 dev lo |
diff --git a/tools/testing/selftests/net/tcp_mmap.c b/tools/testing/selftests/net/tcp_mmap.c index 77f762780199..e8c5dff448eb 100644 --- a/tools/testing/selftests/net/tcp_mmap.c +++ b/tools/testing/selftests/net/tcp_mmap.c | |||
@@ -402,7 +402,7 @@ int main(int argc, char *argv[]) | |||
402 | exit(1); | 402 | exit(1); |
403 | } | 403 | } |
404 | 404 | ||
405 | fd = socket(AF_INET6, SOCK_STREAM, 0); | 405 | fd = socket(cfg_family, SOCK_STREAM, 0); |
406 | if (fd == -1) { | 406 | if (fd == -1) { |
407 | perror("socket"); | 407 | perror("socket"); |
408 | exit(1); | 408 | exit(1); |