commit 633b656
Michael Forney
·
2026-05-01 21:01:14 +0000 UTC
parent 2a228df
strace: Fix build with linux-headers 7.0
2 files changed,
+120,
-1
1@@ -0,0 +1,119 @@
2+From d87c3dbfff0f0cffa8acd227621779f2d5833300 Mon Sep 17 00:00:00 2001
3+From: "Dmitry V. Levin" <ldv@strace.io>
4+Date: Wed, 11 Mar 2026 08:00:00 +0000
5+Subject: [PATCH] bundled: update linux/io_uring/query.h to v7.0-rc3
6+
7+* bundled/linux/include/uapi/linux/io_uring/query.h: Update to
8+headers_install'ed Linux kernel v7.0-rc3.
9+* src/io_uring.c (print_io_uring_query_zcrx): Follow the rename
10+of "__resv1" field of struct io_uring_query_zcrx to "features".
11+* tests/io_uring_register.c (test_IORING_REGISTER_QUERY): Update
12+expected output.
13+---
14+ .../linux/include/uapi/linux/io_uring/query.h | 6 +++++-
15+ src/io_uring.c | 7 ++-----
16+ tests/io_uring_register.c | 16 ++++++++--------
17+ 3 files changed, 15 insertions(+), 14 deletions(-)
18+
19+diff --git a/bundled/linux/include/uapi/linux/io_uring/query.h b/bundled/linux/include/uapi/linux/io_uring/query.h
20+index 2456e6c5e..95500759c 100644
21+--- a/bundled/linux/include/uapi/linux/io_uring/query.h
22++++ b/bundled/linux/include/uapi/linux/io_uring/query.h
23+@@ -1,6 +1,9 @@
24+ /* SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) OR MIT */
25+ /*
26+ * Header file for the io_uring query interface.
27++ *
28++ * Copyright (C) 2026 Pavel Begunkov <asml.silence@gmail.com>
29++ * Copyright (C) Meta Platforms, Inc.
30+ */
31+ #ifndef LINUX_IO_URING_QUERY_H
32+ #define LINUX_IO_URING_QUERY_H
33+@@ -50,7 +53,8 @@ struct io_uring_query_zcrx {
34+ __u64 area_flags;
35+ /* The number of supported ZCRX_CTRL_* opcodes */
36+ __u32 nr_ctrl_opcodes;
37+- __u32 __resv1;
38++ /* Bitmask of ZCRX_FEATURE_* indicating which features are available */
39++ __u32 features;
40+ /* The refill ring header size */
41+ __u32 rq_hdr_size;
42+ /* The alignment for the header */
43+diff --git a/src/io_uring.c b/src/io_uring.c
44+index 04de31651..d6eb63ffe 100644
45+--- a/src/io_uring.c
46++++ b/src/io_uring.c
47+@@ -1538,15 +1538,12 @@ print_io_uring_query_zcrx(struct tcb *tcp, const kernel_ulong_t addr)
48+ tprint_struct_next();
49+ PRINT_FIELD_U(zcrx, nr_ctrl_opcodes);
50+ tprint_struct_next();
51++ PRINT_FIELD_X(zcrx, features);
52++ tprint_struct_next();
53+ PRINT_FIELD_U(zcrx, rq_hdr_size);
54+ tprint_struct_next();
55+ PRINT_FIELD_U(zcrx, rq_hdr_alignment);
56+
57+- if (zcrx.__resv1) {
58+- tprint_struct_next();
59+- PRINT_FIELD_X(zcrx, __resv1);
60+- }
61+-
62+ if (zcrx.__resv2) {
63+ tprint_struct_next();
64+ PRINT_FIELD_X(zcrx, __resv2);
65+diff --git a/tests/io_uring_register.c b/tests/io_uring_register.c
66+index 9952f0370..158c714a0 100644
67+--- a/tests/io_uring_register.c
68++++ b/tests/io_uring_register.c
69+@@ -2373,8 +2373,8 @@ test_IORING_REGISTER_QUERY(int fd_null)
70+ printf("io_uring_register(%u<%s>, " XLAT_FMT
71+ ", {query_data=%p, query_op=" XLAT_FMT ", size=%u, result=0"
72+ ", query_data={register_flags=" XLAT_FMT ", area_flags=" XLAT_FMT
73+- ", nr_ctrl_opcodes=%u, rq_hdr_size=%u, rq_hdr_alignment=%u}"
74+- ", next_entry=NULL}, 0) = %s\n",
75++ ", nr_ctrl_opcodes=%u, features=0, rq_hdr_size=%u"
76++ ", rq_hdr_alignment=%u}, next_entry=NULL}, 0) = %s\n",
77+ fd_null, path_null,
78+ XLAT_SEL(query_ops.val, query_ops.str),
79+ zcrx_data,
80+@@ -2490,8 +2490,8 @@ test_IORING_REGISTER_QUERY(int fd_null)
81+ ", sqe_flags=0, nr_query_opcodes=0}, next_entry="
82+ "{query_data=%p, query_op=" XLAT_FMT ", size=%u, result=0"
83+ ", query_data={register_flags=0, area_flags=0"
84+- ", nr_ctrl_opcodes=%u, rq_hdr_size=0, rq_hdr_alignment=0}"
85+- ", next_entry=NULL}}, 0) = %s\n",
86++ ", nr_ctrl_opcodes=%u, features=0, rq_hdr_size=0"
87++ ", rq_hdr_alignment=0}, next_entry=NULL}}, 0) = %s\n",
88+ fd_null, path_null,
89+ XLAT_SEL(query_ops.val, query_ops.str),
90+ opcode_data2,
91+@@ -2570,22 +2570,22 @@ test_IORING_REGISTER_QUERY(int fd_null)
92+ hdr->result = 0;
93+
94+ memset(zcrx_data, 0, sizeof(*zcrx_data));
95+- zcrx_data->__resv1 = 0xdeadbeef;
96++ zcrx_data->features = 0xdeadbeef;
97+ zcrx_data->__resv2 = 0xcafebabe12345678ULL;
98+
99+ sys_io_uring_register(fd_null, query_ops.val, hdr, 0);
100+ printf("io_uring_register(%u<%s>, " XLAT_FMT
101+ ", {query_data=%p, query_op=" XLAT_FMT ", size=%u, result=0"
102+ ", query_data={register_flags=0, area_flags=0"
103+- ", nr_ctrl_opcodes=0, rq_hdr_size=0"
104+- ", rq_hdr_alignment=0, __resv1=%#x, __resv2=%#llx}"
105++ ", nr_ctrl_opcodes=0, features=%#x, rq_hdr_size=0"
106++ ", rq_hdr_alignment=0, __resv2=%#llx}"
107+ ", next_entry=NULL}, 0) = %s\n",
108+ fd_null, path_null,
109+ XLAT_SEL(query_ops.val, query_ops.str),
110+ zcrx_data,
111+ XLAT_ARGS(IO_URING_QUERY_ZCRX),
112+ (unsigned int) sizeof(*zcrx_data),
113+- zcrx_data->__resv1,
114++ zcrx_data->features,
115+ (unsigned long long) zcrx_data->__resv2,
116+ errstr);
117+
118+--
119+2.49.0
120+
+1,
-1
1@@ -1 +1 @@
2-6.19 r1
3+6.19 r2