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