sergio/takana
> Una distribución Linux construida con un laboratorio funcional y hermético en el > sótano, y una terminal mutable, clásica y anárquica en el piso de arriba — diseñada > desde el suelo para que una IA programadora entienda, modifique y co…
base-system-2: promover 7 tier-2 a canónicas + repo firmado
1From 619b1e60da171d573481d2fbfea7645c8a80d1ae Mon Sep 17 00:00:00 2001
2From: "Dmitry V. Levin" <ldv@strace.io>
3Date: Tue, 10 Mar 2026 08:00:00 +0000
4Subject: [PATCH] bundled: update linux/io_uring.h to v7.0-rc3
5
6* bundled/linux/include/uapi/linux/io_uring.h: Update to
7headers_install'ed Linux kernel v7.0-rc3.
8* src/io_uring.c (print_io_uring_zcrx_ifq_reg): Follow the rename
9of __resv2 field of struct io_uring_zcrx_ifq_reg to rx_buf_len.
10* tests/io_uring_register.c (test_IORING_REGISTER_ZCRX_IFQ): Update
11expected output.
12---
13 bundled/linux/include/uapi/linux/io_uring.h | 35 +++++++++++++++++++--
14 src/io_uring.c | 7 ++---
15 tests/io_uring_register.c | 8 ++---
16 3 files changed, 39 insertions(+), 11 deletions(-)
17
18diff --git a/bundled/linux/include/uapi/linux/io_uring.h b/bundled/linux/include/uapi/linux/io_uring.h
19index b5b23c0d52..1ff16141c8 100644
20--- a/bundled/linux/include/uapi/linux/io_uring.h
21+++ b/bundled/linux/include/uapi/linux/io_uring.h
22@@ -188,7 +188,8 @@ enum io_uring_sqe_flags_bit {
23 /*
24 * If COOP_TASKRUN is set, get notified if task work is available for
25 * running and a kernel transition would be needed to run it. This sets
26- * IORING_SQ_TASKRUN in the sq ring flags. Not valid with COOP_TASKRUN.
27+ * IORING_SQ_TASKRUN in the sq ring flags. Not valid without COOP_TASKRUN
28+ * or DEFER_TASKRUN.
29 */
30 #define IORING_SETUP_TASKRUN_FLAG (1U << 9)
31 #define IORING_SETUP_SQE128 (1U << 10) /* SQEs are 128 byte */
32@@ -237,6 +238,18 @@ enum io_uring_sqe_flags_bit {
33 */
34 #define IORING_SETUP_SQE_MIXED (1U << 19)
35
36+/*
37+ * When set, io_uring ignores SQ head and tail and fetches SQEs to submit
38+ * starting from index 0 instead from the index stored in the head pointer.
39+ * IOW, the user should place all SQE at the beginning of the SQ memory
40+ * before issuing a submission syscall.
41+ *
42+ * It requires IORING_SETUP_NO_SQARRAY and is incompatible with
43+ * IORING_SETUP_SQPOLL. The user must also never change the SQ head and tail
44+ * values and keep it set to 0. Any other value is undefined behaviour.
45+ */
46+#define IORING_SETUP_SQ_REWIND (1U << 20)
47+
48 enum io_uring_op {
49 IORING_OP_NOP,
50 IORING_OP_READV,
51@@ -700,6 +713,9 @@ enum io_uring_register_op {
52 /* auxiliary zcrx configuration, see enum zcrx_ctrl_op */
53 IORING_REGISTER_ZCRX_CTRL = 36,
54
55+ /* register bpf filtering programs */
56+ IORING_REGISTER_BPF_FILTER = 37,
57+
58 /* this goes last */
59 IORING_REGISTER_LAST,
60
61@@ -805,6 +821,13 @@ struct io_uring_restriction {
62 __u32 resv2[3];
63 };
64
65+struct io_uring_task_restriction {
66+ __u16 flags;
67+ __u16 nr_res;
68+ __u32 resv[3];
69+ __DECLARE_FLEX_ARRAY(struct io_uring_restriction, restrictions);
70+};
71+
72 struct io_uring_clock_register {
73 __u32 clockid;
74 __u32 __resv[3];
75@@ -1068,6 +1091,14 @@ enum zcrx_reg_flags {
76 ZCRX_REG_IMPORT = 1,
77 };
78
79+enum zcrx_features {
80+ /*
81+ * The user can ask for the desired rx page size by passing the
82+ * value in struct io_uring_zcrx_ifq_reg::rx_buf_len.
83+ */
84+ ZCRX_FEATURE_RX_PAGE_SIZE = 1 << 0,
85+};
86+
87 /*
88 * Argument for IORING_REGISTER_ZCRX_IFQ
89 */
90@@ -1082,7 +1113,7 @@ struct io_uring_zcrx_ifq_reg {
91
92 struct io_uring_zcrx_offsets offsets;
93 __u32 zcrx_id;
94- __u32 __resv2;
95+ __u32 rx_buf_len;
96 __u64 __resv[3];
97 };
98
99diff --git a/src/io_uring.c b/src/io_uring.c
100index a479c9570a..04de316513 100644
101--- a/src/io_uring.c
102+++ b/src/io_uring.c
103@@ -1254,11 +1254,8 @@ print_io_uring_zcrx_ifq_reg(struct tcb *tcp, const kernel_ulong_t addr)
104 print_io_uring_zcrx_offsets(tcp, &arg.offsets);
105 tprint_struct_next();
106 PRINT_FIELD_U(arg, zcrx_id);
107-
108- if (arg.__resv2) {
109- tprint_struct_next();
110- PRINT_FIELD_X(arg, __resv2);
111- }
112+ tprint_struct_next();
113+ PRINT_FIELD_U(arg, rx_buf_len);
114
115 if (!IS_ARRAY_ZERO(arg.__resv)) {
116 tprint_struct_next();
117diff --git a/tests/io_uring_register.c b/tests/io_uring_register.c
118index cfaa93d208..9952f0370e 100644
119--- a/tests/io_uring_register.c
120+++ b/tests/io_uring_register.c
121@@ -2058,7 +2058,7 @@ test_IORING_REGISTER_ZCRX_IFQ(int fd_null)
122 ", flags=" XLAT_FMT
123 ", area_ptr=%#llx, region_ptr=%#llx"
124 ", offsets={head=%u, tail=%u, rqes=%u}"
125- ", zcrx_id=%u}, 1) = %s\n",
126+ ", zcrx_id=%u, rx_buf_len=0}, 1) = %s\n",
127 fd_null, path_null,
128 XLAT_SEL(zcrx_ifq_ops.val, zcrx_ifq_ops.str),
129 zcrx_ifq->if_idx, zcrx_ifq->if_rxq, zcrx_ifq->rq_entries,
130@@ -2073,9 +2073,9 @@ test_IORING_REGISTER_ZCRX_IFQ(int fd_null)
131 memset(zcrx_ifq, 0, sizeof(*zcrx_ifq));
132 zcrx_ifq->if_idx = 0xaaaa;
133 zcrx_ifq->offsets.__resv2 = 0xbbbb;
134- zcrx_ifq->__resv2 = 0xcccc;
135 zcrx_ifq->offsets.__resv[0] = 0xddddddddddddddddULL;
136 zcrx_ifq->offsets.__resv[1] = 0xeeeeeeeeeeeeeeeeULL;
137+ zcrx_ifq->rx_buf_len = 0xcccc;
138 zcrx_ifq->__resv[0] = 0x1111111111111111ULL;
139 zcrx_ifq->__resv[1] = 0x2222222222222222ULL;
140 zcrx_ifq->__resv[2] = 0x3333333333333333ULL;
141@@ -2086,7 +2086,7 @@ test_IORING_REGISTER_ZCRX_IFQ(int fd_null)
142 ", area_ptr=NULL, region_ptr=NULL"
143 ", offsets={head=0, tail=0, rqes=0, __resv2=%#x"
144 ", __resv=[%#llx, %#llx]}"
145- ", zcrx_id=0, __resv2=%#x"
146+ ", zcrx_id=0, rx_buf_len=%u"
147 ", __resv=[%#llx, %#llx, %#llx]}, 1) = %s\n",
148 fd_null, path_null,
149 XLAT_SEL(zcrx_ifq_ops.val, zcrx_ifq_ops.str),
150@@ -2094,7 +2094,7 @@ test_IORING_REGISTER_ZCRX_IFQ(int fd_null)
151 zcrx_ifq->offsets.__resv2,
152 (unsigned long long) zcrx_ifq->offsets.__resv[0],
153 (unsigned long long) zcrx_ifq->offsets.__resv[1],
154- zcrx_ifq->__resv2,
155+ zcrx_ifq->rx_buf_len,
156 (unsigned long long) zcrx_ifq->__resv[0],
157 (unsigned long long) zcrx_ifq->__resv[1],
158 (unsigned long long) zcrx_ifq->__resv[2],
159From 81fb4e6cd8b22acc51b8f7226a60a75825087d7b Mon Sep 17 00:00:00 2001
160From: "Dmitry V. Levin" <ldv@strace.io>
161Date: Wed, 11 Mar 2026 08:00:00 +0000
162Subject: [PATCH] bundled: update linux/io_uring/query.h to v7.0-rc3
163
164* bundled/linux/include/uapi/linux/io_uring/query.h: Update to
165headers_install'ed Linux kernel v7.0-rc3.
166* src/io_uring.c (print_io_uring_query_zcrx): Follow the rename
167of "__resv1" field of struct io_uring_query_zcrx to "features".
168* tests/io_uring_register.c (test_IORING_REGISTER_QUERY): Update
169expected output.
170---
171 .../linux/include/uapi/linux/io_uring/query.h | 6 +++++-
172 src/io_uring.c | 7 ++-----
173 tests/io_uring_register.c | 16 ++++++++--------
174 3 files changed, 15 insertions(+), 14 deletions(-)
175
176diff --git a/bundled/linux/include/uapi/linux/io_uring/query.h b/bundled/linux/include/uapi/linux/io_uring/query.h
177index 2456e6c5e..95500759c 100644
178--- a/bundled/linux/include/uapi/linux/io_uring/query.h
179+++ b/bundled/linux/include/uapi/linux/io_uring/query.h
180@@ -1,6 +1,9 @@
181 /* SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) OR MIT */
182 /*
183 * Header file for the io_uring query interface.
184+ *
185+ * Copyright (C) 2026 Pavel Begunkov <asml.silence@gmail.com>
186+ * Copyright (C) Meta Platforms, Inc.
187 */
188 #ifndef LINUX_IO_URING_QUERY_H
189 #define LINUX_IO_URING_QUERY_H
190@@ -50,7 +53,8 @@ struct io_uring_query_zcrx {
191 __u64 area_flags;
192 /* The number of supported ZCRX_CTRL_* opcodes */
193 __u32 nr_ctrl_opcodes;
194- __u32 __resv1;
195+ /* Bitmask of ZCRX_FEATURE_* indicating which features are available */
196+ __u32 features;
197 /* The refill ring header size */
198 __u32 rq_hdr_size;
199 /* The alignment for the header */
200diff --git a/src/io_uring.c b/src/io_uring.c
201index 04de31651..d6eb63ffe 100644
202--- a/src/io_uring.c
203+++ b/src/io_uring.c
204@@ -1538,15 +1538,12 @@ print_io_uring_query_zcrx(struct tcb *tcp, const kernel_ulong_t addr)
205 tprint_struct_next();
206 PRINT_FIELD_U(zcrx, nr_ctrl_opcodes);
207 tprint_struct_next();
208+ PRINT_FIELD_X(zcrx, features);
209+ tprint_struct_next();
210 PRINT_FIELD_U(zcrx, rq_hdr_size);
211 tprint_struct_next();
212 PRINT_FIELD_U(zcrx, rq_hdr_alignment);
213
214- if (zcrx.__resv1) {
215- tprint_struct_next();
216- PRINT_FIELD_X(zcrx, __resv1);
217- }
218-
219 if (zcrx.__resv2) {
220 tprint_struct_next();
221 PRINT_FIELD_X(zcrx, __resv2);
222diff --git a/tests/io_uring_register.c b/tests/io_uring_register.c
223index 9952f0370..158c714a0 100644
224--- a/tests/io_uring_register.c
225+++ b/tests/io_uring_register.c
226@@ -2373,8 +2373,8 @@ test_IORING_REGISTER_QUERY(int fd_null)
227 printf("io_uring_register(%u<%s>, " XLAT_FMT
228 ", {query_data=%p, query_op=" XLAT_FMT ", size=%u, result=0"
229 ", query_data={register_flags=" XLAT_FMT ", area_flags=" XLAT_FMT
230- ", nr_ctrl_opcodes=%u, rq_hdr_size=%u, rq_hdr_alignment=%u}"
231- ", next_entry=NULL}, 0) = %s\n",
232+ ", nr_ctrl_opcodes=%u, features=0, rq_hdr_size=%u"
233+ ", rq_hdr_alignment=%u}, next_entry=NULL}, 0) = %s\n",
234 fd_null, path_null,
235 XLAT_SEL(query_ops.val, query_ops.str),
236 zcrx_data,
237@@ -2490,8 +2490,8 @@ test_IORING_REGISTER_QUERY(int fd_null)
238 ", sqe_flags=0, nr_query_opcodes=0}, next_entry="
239 "{query_data=%p, query_op=" XLAT_FMT ", size=%u, result=0"
240 ", query_data={register_flags=0, area_flags=0"
241- ", nr_ctrl_opcodes=%u, rq_hdr_size=0, rq_hdr_alignment=0}"
242- ", next_entry=NULL}}, 0) = %s\n",
243+ ", nr_ctrl_opcodes=%u, features=0, rq_hdr_size=0"
244+ ", rq_hdr_alignment=0}, next_entry=NULL}}, 0) = %s\n",
245 fd_null, path_null,
246 XLAT_SEL(query_ops.val, query_ops.str),
247 opcode_data2,
248@@ -2570,22 +2570,22 @@ test_IORING_REGISTER_QUERY(int fd_null)
249 hdr->result = 0;
250
251 memset(zcrx_data, 0, sizeof(*zcrx_data));
252- zcrx_data->__resv1 = 0xdeadbeef;
253+ zcrx_data->features = 0xdeadbeef;
254 zcrx_data->__resv2 = 0xcafebabe12345678ULL;
255
256 sys_io_uring_register(fd_null, query_ops.val, hdr, 0);
257 printf("io_uring_register(%u<%s>, " XLAT_FMT
258 ", {query_data=%p, query_op=" XLAT_FMT ", size=%u, result=0"
259 ", query_data={register_flags=0, area_flags=0"
260- ", nr_ctrl_opcodes=0, rq_hdr_size=0"
261- ", rq_hdr_alignment=0, __resv1=%#x, __resv2=%#llx}"
262+ ", nr_ctrl_opcodes=0, features=%#x, rq_hdr_size=0"
263+ ", rq_hdr_alignment=0, __resv2=%#llx}"
264 ", next_entry=NULL}, 0) = %s\n",
265 fd_null, path_null,
266 XLAT_SEL(query_ops.val, query_ops.str),
267 zcrx_data,
268 XLAT_ARGS(IO_URING_QUERY_ZCRX),
269 (unsigned int) sizeof(*zcrx_data),
270- zcrx_data->__resv1,
271+ zcrx_data->features,
272 (unsigned long long) zcrx_data->__resv2,
273 errstr);
274