Files
linux/include/uapi/linux
Alan Maguire f7a6b9eaff bpf: Extend BTF UAPI vlen, kinds to use unused bits
BTF maximum vlen is encoded using 16 bits with a maximum vlen
of 65535.  This has sufficed for structs, function parameters
and enumerated type values.  However, with upcoming BTF location
information - in particular information about inline sites -
this limit is surpassed.  Use bits 16-23 - currently unused in
BTF info - to extend to 24 bits, giving a max vlen of (2^24 - 1),
or 16 million.

Also extend BTF kind encoding from 5 to 7 bits, giving a maximum
available number of kinds of 128.  Since with the BTF location work
we use another 3 kinds, we are fast approaching the current limit
of 32.

Convert BTF_MAX_* values to enums to allow them to be encoded in
kernel BTF; this will allow us to detect if the running kernel
supports a 24-bit vlen or not.  Add one for max _possible_
(not used) kind.

Fix up a few places in the kernel where a 16-bit vlen is assumed;
remove BTF_INFO_MASK as now all bits are used.

The vlen expansion was suggested by Andrii in [1]; the kind expansion
is tackled here too as it may be needed also to support new kinds
in BTF.

[1] https://lore.kernel.org/bpf/CAEf4BzZx=X6vGqcA8SPU6D+v6k+TR=ZewebXMuXtpmML058piw@mail.gmail.com/

Suggested-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
Acked-by: Mykyta Yatsenko <yatsenko@meta.com>
Link: https://lore.kernel.org/r/20260417143023.1551481-2-alan.maguire@oracle.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2026-04-20 17:52:48 -07:00
..
2024-04-15 13:42:38 +02:00
2022-08-11 10:31:19 -07:00
2026-03-05 22:16:08 -05:00
2026-03-19 11:38:24 -06:00
2026-03-18 09:59:57 +00:00
2025-02-05 13:22:04 +09:00
2023-01-20 09:33:22 +00:00
2024-06-11 12:57:49 -05:00
2026-03-05 16:26:52 +01:00
2026-01-18 11:22:53 -05:00
2025-02-12 02:29:30 +00:00
2025-10-28 22:59:19 +01:00
2025-11-25 19:20:42 -08:00
2025-09-05 09:11:28 +02:00
2025-05-03 12:02:09 +02:00
2022-08-10 13:49:50 +01:00
2025-11-24 17:52:11 +01:00
2025-11-24 17:52:11 +01:00
2024-05-07 01:35:57 +02:00
2025-11-29 21:39:58 +09:00
2025-12-23 12:29:14 +05:30
2024-04-01 10:49:28 +01:00
2025-09-15 14:32:54 +02:00
2024-06-01 07:28:21 +02:00
2024-09-01 20:26:05 -07:00
2022-09-20 09:13:38 +02:00
2024-08-19 22:36:26 -04:00
2026-01-12 16:52:09 +01:00
2025-07-08 12:39:24 +02:00
2023-12-15 17:01:30 +01:00
2026-03-12 13:33:54 +01:00
2026-02-06 20:35:06 -08:00
2024-09-06 08:31:40 -06:00
2026-04-09 18:21:45 -07:00
2022-09-07 16:46:03 +02:00
2024-08-12 17:50:34 -07:00
2026-02-27 19:21:56 -08:00
2025-11-03 17:41:18 +01:00
2023-11-28 19:05:16 +00:00
2025-01-08 13:18:11 +01:00
2025-11-25 19:20:42 -08:00
2023-12-20 19:26:31 -05:00
2025-02-25 18:14:03 -08:00
2026-03-31 07:04:00 -06:00
2026-01-26 19:07:10 -08:00
2025-07-14 18:41:42 -07:00
2022-11-17 11:04:23 -08:00
2025-06-19 14:28:22 +02:00
2025-05-21 13:41:03 +02:00
2023-12-29 11:58:24 -08:00
2023-03-23 17:25:46 +01:00
2026-02-09 12:21:32 -05:00
2025-09-22 09:29:28 +01:00
2025-11-30 18:02:43 -05:00
2025-05-27 10:27:54 -04:00
2025-09-22 09:29:29 +01:00