diff options
Diffstat (limited to 'tools/include/uapi')
| -rw-r--r-- | tools/include/uapi/asm-generic/fcntl.h | 1 | ||||
| -rw-r--r-- | tools/include/uapi/linux/bpf.h | 112 | ||||
| -rw-r--r-- | tools/include/uapi/linux/hw_breakpoint.h | 10 | ||||
| -rw-r--r-- | tools/include/uapi/linux/if_link.h | 1 | ||||
| -rw-r--r-- | tools/include/uapi/linux/kvm.h | 2 | ||||
| -rw-r--r-- | tools/include/uapi/linux/perf_event.h | 3 | ||||
| -rw-r--r-- | tools/include/uapi/linux/prctl.h | 2 | 
7 files changed, 105 insertions, 26 deletions
diff --git a/tools/include/uapi/asm-generic/fcntl.h b/tools/include/uapi/asm-generic/fcntl.h index b02c8e0f4057..1c7a0f6632c0 100644 --- a/tools/include/uapi/asm-generic/fcntl.h +++ b/tools/include/uapi/asm-generic/fcntl.h @@ -91,7 +91,6 @@  /* a horrid kludge trying to make sure that this will fail on old kernels */  #define O_TMPFILE (__O_TMPFILE | O_DIRECTORY) -#define O_TMPFILE_MASK (__O_TMPFILE | O_DIRECTORY | O_CREAT)        #ifndef O_NDELAY  #define O_NDELAY	O_NONBLOCK diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index 62ce1f5d1b1d..1bb11a6ee667 100644 --- a/tools/include/uapi/linux/bpf.h +++ b/tools/include/uapi/linux/bpf.h @@ -986,6 +986,7 @@ enum bpf_prog_type {  	BPF_PROG_TYPE_LSM,  	BPF_PROG_TYPE_SK_LOOKUP,  	BPF_PROG_TYPE_SYSCALL, /* a program that can execute syscalls */ +	BPF_PROG_TYPE_NETFILTER,  };  enum bpf_attach_type { @@ -1033,6 +1034,7 @@ enum bpf_attach_type {  	BPF_PERF_EVENT,  	BPF_TRACE_KPROBE_MULTI,  	BPF_LSM_CGROUP, +	BPF_STRUCT_OPS,  	__MAX_BPF_ATTACH_TYPE  }; @@ -1049,6 +1051,7 @@ enum bpf_link_type {  	BPF_LINK_TYPE_PERF_EVENT = 7,  	BPF_LINK_TYPE_KPROBE_MULTI = 8,  	BPF_LINK_TYPE_STRUCT_OPS = 9, +	BPF_LINK_TYPE_NETFILTER = 10,  	MAX_BPF_LINK_TYPE,  }; @@ -1108,7 +1111,7 @@ enum bpf_link_type {   */  #define BPF_F_STRICT_ALIGNMENT	(1U << 0) -/* If BPF_F_ANY_ALIGNMENT is used in BPF_PROF_LOAD command, the +/* If BPF_F_ANY_ALIGNMENT is used in BPF_PROG_LOAD command, the   * verifier will allow any alignment whatsoever.  On platforms   * with strict alignment requirements for loads ands stores (such   * as sparc and mips) the verifier validates that all loads and @@ -1266,6 +1269,9 @@ enum {  /* Create a map that is suitable to be an inner map with dynamic max entries */  	BPF_F_INNER_MAP		= (1U << 12), + +/* Create a map that will be registered/unregesitered by the backed bpf_link */ +	BPF_F_LINK		= (1U << 13),  };  /* Flags for BPF_PROG_QUERY. */ @@ -1403,6 +1409,11 @@ union bpf_attr {  		__aligned_u64	fd_array;	/* array of FDs */  		__aligned_u64	core_relos;  		__u32		core_relo_rec_size; /* sizeof(struct bpf_core_relo) */ +		/* output: actual total log contents size (including termintaing zero). +		 * It could be both larger than original log_size (if log was +		 * truncated), or smaller (if log buffer wasn't filled completely). +		 */ +		__u32		log_true_size;  	};  	struct { /* anonymous struct used by BPF_OBJ_* commands */ @@ -1488,6 +1499,11 @@ union bpf_attr {  		__u32		btf_size;  		__u32		btf_log_size;  		__u32		btf_log_level; +		/* output: actual total log contents size (including termintaing zero). +		 * It could be both larger than original log_size (if log was +		 * truncated), or smaller (if log buffer wasn't filled completely). +		 */ +		__u32		btf_log_true_size;  	};  	struct { @@ -1507,7 +1523,10 @@ union bpf_attr {  	} task_fd_query;  	struct { /* struct used by BPF_LINK_CREATE command */ -		__u32		prog_fd;	/* eBPF program to attach */ +		union { +			__u32		prog_fd;	/* eBPF program to attach */ +			__u32		map_fd;		/* struct_ops to attach */ +		};  		union {  			__u32		target_fd;	/* object to attach to */  			__u32		target_ifindex; /* target ifindex */ @@ -1543,17 +1562,34 @@ union bpf_attr {  				 */  				__u64		cookie;  			} tracing; +			struct { +				__u32		pf; +				__u32		hooknum; +				__s32		priority; +				__u32		flags; +			} netfilter;  		};  	} link_create;  	struct { /* struct used by BPF_LINK_UPDATE command */  		__u32		link_fd;	/* link fd */ -		/* new program fd to update link with */ -		__u32		new_prog_fd; +		union { +			/* new program fd to update link with */ +			__u32		new_prog_fd; +			/* new struct_ops map fd to update link with */ +			__u32           new_map_fd; +		};  		__u32		flags;		/* extra flags */ -		/* expected link's program fd; is specified only if -		 * BPF_F_REPLACE flag is set in flags */ -		__u32		old_prog_fd; +		union { +			/* expected link's program fd; is specified only if +			 * BPF_F_REPLACE flag is set in flags. +			 */ +			__u32		old_prog_fd; +			/* expected link's map fd; is specified only +			 * if BPF_F_REPLACE flag is set. +			 */ +			__u32           old_map_fd; +		};  	} link_update;  	struct { @@ -1647,17 +1683,17 @@ union bpf_attr {   * 	Description   * 		This helper is a "printk()-like" facility for debugging. It   * 		prints a message defined by format *fmt* (of size *fmt_size*) - * 		to file *\/sys/kernel/debug/tracing/trace* from DebugFS, if + * 		to file *\/sys/kernel/tracing/trace* from TraceFS, if   * 		available. It can take up to three additional **u64**   * 		arguments (as an eBPF helpers, the total number of arguments is   * 		limited to five).   *   * 		Each time the helper is called, it appends a line to the trace. - * 		Lines are discarded while *\/sys/kernel/debug/tracing/trace* is - * 		open, use *\/sys/kernel/debug/tracing/trace_pipe* to avoid this. + * 		Lines are discarded while *\/sys/kernel/tracing/trace* is + * 		open, use *\/sys/kernel/tracing/trace_pipe* to avoid this.   * 		The format of the trace is customizable, and the exact output   * 		one will get depends on the options set in - * 		*\/sys/kernel/debug/tracing/trace_options* (see also the + * 		*\/sys/kernel/tracing/trace_options* (see also the   * 		*README* file under the same directory). However, it usually   * 		defaults to something like:   * @@ -4969,6 +5005,12 @@ union bpf_attr {   *		different maps if key/value layout matches across maps.   *		Every bpf_timer_set_callback() can have different callback_fn.   * + *		*flags* can be one of: + * + *		**BPF_F_TIMER_ABS** + *			Start the timer in absolute expire value instead of the + *			default relative one. + *   *	Return   *		0 on success.   *		**-EINVAL** if *timer* was not initialized with bpf_timer_init() earlier @@ -5325,11 +5367,22 @@ union bpf_attr {   *	Description   *		Write *len* bytes from *src* into *dst*, starting from *offset*   *		into *dst*. - *		*flags* is currently unused. + * + *		*flags* must be 0 except for skb-type dynptrs. + * + *		For skb-type dynptrs: + *		    *  All data slices of the dynptr are automatically + *		       invalidated after **bpf_dynptr_write**\ (). This is + *		       because writing may pull the skb and change the + *		       underlying packet buffer. + * + *		    *  For *flags*, please see the flags accepted by + *		       **bpf_skb_store_bytes**\ ().   *	Return   *		0 on success, -E2BIG if *offset* + *len* exceeds the length   *		of *dst*'s data, -EINVAL if *dst* is an invalid dynptr or if *dst* - *		is a read-only dynptr or if *flags* is not 0. + *		is a read-only dynptr or if *flags* is not correct. For skb-type dynptrs, + *		other errors correspond to errors returned by **bpf_skb_store_bytes**\ ().   *   * void *bpf_dynptr_data(const struct bpf_dynptr *ptr, u32 offset, u32 len)   *	Description @@ -5337,6 +5390,9 @@ union bpf_attr {   *   *		*len* must be a statically known value. The returned data slice   *		is invalidated whenever the dynptr is invalidated. + * + *		skb and xdp type dynptrs may not use bpf_dynptr_data. They should + *		instead use bpf_dynptr_slice and bpf_dynptr_slice_rdwr.   *	Return   *		Pointer to the underlying dynptr data, NULL if the dynptr is   *		read-only, if the dynptr is invalid, or if the offset and length @@ -6359,6 +6415,15 @@ struct bpf_link_info {  		struct {  			__u32 ifindex;  		} xdp; +		struct { +			__u32 map_id; +		} struct_ops; +		struct { +			__u32 pf; +			__u32 hooknum; +			__s32 priority; +			__u32 flags; +		} netfilter;  	};  } __attribute__((aligned(8))); @@ -6934,6 +6999,10 @@ struct bpf_rb_node {  	__u64 :64;  } __attribute__((aligned(8))); +struct bpf_refcount { +	__u32 :32; +} __attribute__((aligned(4))); +  struct bpf_sysctl {  	__u32	write;		/* Sysctl is being read (= 0) or written (= 1).  				 * Allows 1,2,4-byte read, but no write. @@ -7083,4 +7152,21 @@ struct bpf_core_relo {  	enum bpf_core_relo_kind kind;  }; +/* + * Flags to control bpf_timer_start() behaviour. + *     - BPF_F_TIMER_ABS: Timeout passed is absolute time, by default it is + *       relative to current time. + */ +enum { +	BPF_F_TIMER_ABS = (1ULL << 0), +}; + +/* BPF numbers iterator state */ +struct bpf_iter_num { +	/* opaque iterator state; having __u64 here allows to preserve correct +	 * alignment requirements in vmlinux.h, generated from BTF +	 */ +	__u64 __opaque[1]; +} __attribute__((aligned(8))); +  #endif /* _UAPI__LINUX_BPF_H__ */ diff --git a/tools/include/uapi/linux/hw_breakpoint.h b/tools/include/uapi/linux/hw_breakpoint.h index 965e4d8606d8..1575d3ca6f0d 100644 --- a/tools/include/uapi/linux/hw_breakpoint.h +++ b/tools/include/uapi/linux/hw_breakpoint.h @@ -22,14 +22,4 @@ enum {  	HW_BREAKPOINT_INVALID   = HW_BREAKPOINT_RW | HW_BREAKPOINT_X,  }; -enum bp_type_idx { -	TYPE_INST 	= 0, -#ifdef CONFIG_HAVE_MIXED_BREAKPOINTS_REGS -	TYPE_DATA	= 0, -#else -	TYPE_DATA	= 1, -#endif -	TYPE_MAX -}; -  #endif /* _UAPI_LINUX_HW_BREAKPOINT_H */ diff --git a/tools/include/uapi/linux/if_link.h b/tools/include/uapi/linux/if_link.h index 901d98b865a1..39e659c83cfd 100644 --- a/tools/include/uapi/linux/if_link.h +++ b/tools/include/uapi/linux/if_link.h @@ -605,6 +605,7 @@ enum {  	IFLA_MACVLAN_MACADDR_COUNT,  	IFLA_MACVLAN_BC_QUEUE_LEN,  	IFLA_MACVLAN_BC_QUEUE_LEN_USED, +	IFLA_MACVLAN_BC_CUTOFF,  	__IFLA_MACVLAN_MAX,  }; diff --git a/tools/include/uapi/linux/kvm.h b/tools/include/uapi/linux/kvm.h index d77aef872a0a..4003a166328c 100644 --- a/tools/include/uapi/linux/kvm.h +++ b/tools/include/uapi/linux/kvm.h @@ -1451,7 +1451,7 @@ struct kvm_vfio_spapr_tce {  #define KVM_CREATE_VCPU           _IO(KVMIO,   0x41)  #define KVM_GET_DIRTY_LOG         _IOW(KVMIO,  0x42, struct kvm_dirty_log)  #define KVM_SET_NR_MMU_PAGES      _IO(KVMIO,   0x44) -#define KVM_GET_NR_MMU_PAGES      _IO(KVMIO,   0x45) +#define KVM_GET_NR_MMU_PAGES      _IO(KVMIO,   0x45)  /* deprecated */  #define KVM_SET_USER_MEMORY_REGION _IOW(KVMIO, 0x46, \  					struct kvm_userspace_memory_region)  #define KVM_SET_TSS_ADDR          _IO(KVMIO,   0x47) diff --git a/tools/include/uapi/linux/perf_event.h b/tools/include/uapi/linux/perf_event.h index 37675437b768..39c6a250dd1b 100644 --- a/tools/include/uapi/linux/perf_event.h +++ b/tools/include/uapi/linux/perf_event.h @@ -1339,7 +1339,8 @@ union perf_mem_data_src {  #define PERF_MEM_LVLNUM_L2	0x02 /* L2 */  #define PERF_MEM_LVLNUM_L3	0x03 /* L3 */  #define PERF_MEM_LVLNUM_L4	0x04 /* L4 */ -/* 5-0x8 available */ +/* 5-0x7 available */ +#define PERF_MEM_LVLNUM_UNC	0x08 /* Uncached */  #define PERF_MEM_LVLNUM_CXL	0x09 /* CXL */  #define PERF_MEM_LVLNUM_IO	0x0a /* I/O */  #define PERF_MEM_LVLNUM_ANY_CACHE 0x0b /* Any cache */ diff --git a/tools/include/uapi/linux/prctl.h b/tools/include/uapi/linux/prctl.h index 1312a137f7fb..759b3f53e53f 100644 --- a/tools/include/uapi/linux/prctl.h +++ b/tools/include/uapi/linux/prctl.h @@ -290,4 +290,6 @@ struct prctl_mm_map {  #define PR_SET_VMA		0x53564d41  # define PR_SET_VMA_ANON_NAME		0 +#define PR_SET_MEMORY_MERGE		67 +#define PR_GET_MEMORY_MERGE		68  #endif /* _LINUX_PRCTL_H */  |