aboutsummaryrefslogtreecommitdiffstats
path: root/tools/include/uapi/linux/bpf.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/include/uapi/linux/bpf.h')
-rw-r--r--tools/include/uapi/linux/bpf.h35
1 files changed, 34 insertions, 1 deletions
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index 63e0cf66f01a..7c6aef253173 100644
--- a/tools/include/uapi/linux/bpf.h
+++ b/tools/include/uapi/linux/bpf.h
@@ -260,6 +260,24 @@ enum bpf_attach_type {
260 */ 260 */
261#define BPF_F_ANY_ALIGNMENT (1U << 1) 261#define BPF_F_ANY_ALIGNMENT (1U << 1)
262 262
263/* BPF_F_TEST_RND_HI32 is used in BPF_PROG_LOAD command for testing purpose.
264 * Verifier does sub-register def/use analysis and identifies instructions whose
265 * def only matters for low 32-bit, high 32-bit is never referenced later
266 * through implicit zero extension. Therefore verifier notifies JIT back-ends
267 * that it is safe to ignore clearing high 32-bit for these instructions. This
268 * saves some back-ends a lot of code-gen. However such optimization is not
269 * necessary on some arches, for example x86_64, arm64 etc, whose JIT back-ends
270 * hence hasn't used verifier's analysis result. But, we really want to have a
271 * way to be able to verify the correctness of the described optimization on
272 * x86_64 on which testsuites are frequently exercised.
273 *
274 * So, this flag is introduced. Once it is set, verifier will randomize high
275 * 32-bit for those instructions who has been identified as safe to ignore them.
276 * Then, if verifier is not doing correct analysis, such randomization will
277 * regress tests to expose bugs.
278 */
279#define BPF_F_TEST_RND_HI32 (1U << 2)
280
263/* When BPF ldimm64's insn[0].src_reg != 0 then this can have 281/* When BPF ldimm64's insn[0].src_reg != 0 then this can have
264 * two extensions: 282 * two extensions:
265 * 283 *
@@ -2672,6 +2690,20 @@ union bpf_attr {
2672 * 0 on success. 2690 * 0 on success.
2673 * 2691 *
2674 * **-ENOENT** if the bpf-local-storage cannot be found. 2692 * **-ENOENT** if the bpf-local-storage cannot be found.
2693 *
2694 * int bpf_send_signal(u32 sig)
2695 * Description
2696 * Send signal *sig* to the current task.
2697 * Return
2698 * 0 on success or successfully queued.
2699 *
2700 * **-EBUSY** if work queue under nmi is full.
2701 *
2702 * **-EINVAL** if *sig* is invalid.
2703 *
2704 * **-EPERM** if no permission to send the *sig*.
2705 *
2706 * **-EAGAIN** if bpf program can try again.
2675 */ 2707 */
2676#define __BPF_FUNC_MAPPER(FN) \ 2708#define __BPF_FUNC_MAPPER(FN) \
2677 FN(unspec), \ 2709 FN(unspec), \
@@ -2782,7 +2814,8 @@ union bpf_attr {
2782 FN(strtol), \ 2814 FN(strtol), \
2783 FN(strtoul), \ 2815 FN(strtoul), \
2784 FN(sk_storage_get), \ 2816 FN(sk_storage_get), \
2785 FN(sk_storage_delete), 2817 FN(sk_storage_delete), \
2818 FN(send_signal),
2786 2819
2787/* integer value in 'imm' field of BPF_CALL instruction selects which helper 2820/* integer value in 'imm' field of BPF_CALL instruction selects which helper
2788 * function eBPF program intends to call 2821 * function eBPF program intends to call