summaryrefslogtreecommitdiff
path: root/pkg/strace/patch/0013-io_uring-Add-io_cqring_offset-flags.patch
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2020-08-13 02:05:36 -0700
committerMichael Forney <mforney@mforney.org>2020-08-13 02:05:36 -0700
commitf936cfb15b1657e4e256b712170953fc6b1ab6c6 (patch)
treec096b552f346600d977f5cb73a4dba9ac8736222 /pkg/strace/patch/0013-io_uring-Add-io_cqring_offset-flags.patch
parente36dab4af887d3be3abd8d09d5857ef300dff75a (diff)
strace: Update to 5.8
Diffstat (limited to 'pkg/strace/patch/0013-io_uring-Add-io_cqring_offset-flags.patch')
-rw-r--r--pkg/strace/patch/0013-io_uring-Add-io_cqring_offset-flags.patch208
1 files changed, 0 insertions, 208 deletions
diff --git a/pkg/strace/patch/0013-io_uring-Add-io_cqring_offset-flags.patch b/pkg/strace/patch/0013-io_uring-Add-io_cqring_offset-flags.patch
deleted file mode 100644
index 9bd2b5d7..00000000
--- a/pkg/strace/patch/0013-io_uring-Add-io_cqring_offset-flags.patch
+++ /dev/null
@@ -1,208 +0,0 @@
-From 7be4c3c00f7b7568b4c7602e8430e90d2df91e3b Mon Sep 17 00:00:00 2001
-From: Chris Packham <chris.packham@alliedtelesis.co.nz>
-Date: Mon, 15 Jun 2020 22:01:26 +1200
-Subject: [PATCH] io_uring: Add io_cqring_offset flags
-
-Add support for displaying struct io_cqring_offsets.flags introduced
-by Linux kernel commits v5.8-rc1~190^2~22 and v5.8-rc1~190^2~21.
-
-* types/io_uring.h (struct_io_cqring_offsets): Replace resv array
-with flags, resv1, and resv2 fields.
-* xlat/uring_cqring_flags.in: New file.
-* configure.ac (AC_CHECK_MEMBERS): Check struct io_cqring_offsets.flags.
-* io_uring.c: Include "xlat/uring_cqring_flags.h".
-(SYS_FUNC(io_uring_setup)): Replace printing of the resv array
-of struct io_cqring_offsets with flags, resv1, and resv2 fields.
-* tests/io_uring_setup.c: Check it.
-
-Co-authored-by: Dmitry V. Levin <ldv@altlinux.org>
-Resolves: https://github.com/strace/strace/issues/138
----
- configure.ac | 1 +
- io_uring.c | 11 +++++----
- tests/io_uring_setup.c | 31 ++++++++++++++++++++----
- types/io_uring.h | 4 +++-
- xlat/uring_cqring_flags.h | 48 ++++++++++++++++++++++++++++++++++++++
- xlat/uring_cqring_flags.in | 1 +
- 6 files changed, 86 insertions(+), 10 deletions(-)
- create mode 100644 xlat/uring_cqring_flags.h
- create mode 100644 xlat/uring_cqring_flags.in
-
-diff --git a/configure.ac b/configure.ac
-index d0fd51ff..91c2249e 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -481,6 +481,7 @@ AC_CHECK_HEADERS([linux/bpf.h], [
-
- AC_CHECK_HEADERS([linux/io_uring.h], [
- AC_CHECK_MEMBERS(m4_normalize([
-+ struct io_cqring_offsets.flags,
- struct io_uring_params.features,
- struct io_uring_params.wq_fd,
- struct io_uring_params.resv
-diff --git a/io_uring.c b/io_uring.c
-index cfeea82b..2ffe163e 100644
---- a/io_uring.c
-+++ b/io_uring.c
-@@ -17,6 +17,7 @@
- #include "xlat/uring_setup_flags.h"
- #include "xlat/uring_enter_flags.h"
- #include "xlat/uring_register_opcodes.h"
-+#include "xlat/uring_cqring_flags.h"
-
- #ifdef HAVE_STRUCT_IO_URING_PARAMS
- # ifdef HAVE_STRUCT_IO_URING_PARAMS_RESV
-@@ -88,10 +89,12 @@ SYS_FUNC(io_uring_setup)
- PRINT_FIELD_U(", ", params.cq_off, ring_entries);
- PRINT_FIELD_U(", ", params.cq_off, overflow);
- PRINT_FIELD_U(", ", params.cq_off, cqes);
-- if (!IS_ARRAY_ZERO(params.cq_off.resv)) {
-- PRINT_FIELD_ARRAY(", ", params.cq_off, resv, tcp,
-- print_xint64_array_member);
-- }
-+ PRINT_FIELD_FLAGS(", ", params.cq_off, flags,
-+ uring_cqring_flags, "IORING_CQ_???");
-+ if (params.cq_off.resv1)
-+ PRINT_FIELD_X(", ", params.cq_off, resv1);
-+ if (params.cq_off.resv2)
-+ PRINT_FIELD_X(", ", params.cq_off, resv2);
- tprints("}");
- }
- tprints("}");
-diff --git a/tests/io_uring_setup.c b/tests/io_uring_setup.c
-index 317b0d7a..a59e4a1a 100644
---- a/tests/io_uring_setup.c
-+++ b/tests/io_uring_setup.c
-@@ -27,6 +27,7 @@
- # include "xlat.h"
-
- # include "xlat/uring_setup_features.h"
-+# include "xlat/uring_cqring_flags.h"
-
- # ifdef HAVE_STRUCT_IO_URING_PARAMS_FEATURES
- # ifdef HAVE_STRUCT_IO_URING_PARAMS_WQ_FD
-@@ -144,20 +145,40 @@ main(void)
- params->sq_off.resv2);
-
- printf("}, cq_off={head=%u, tail=%u, ring_mask=%u"
-- ", ring_entries=%u, overflow=%u, cqes=%u",
-+ ", ring_entries=%u, overflow=%u, cqes=%u, flags=",
- params->cq_off.head,
- params->cq_off.tail,
- params->cq_off.ring_mask,
- params->cq_off.ring_entries,
- params->cq_off.overflow,
- params->cq_off.cqes);
-- if (params->cq_off.resv[0] || params->cq_off.resv[1]) {
-- printf(", resv=[%#llx, %#llx]",
-+#ifdef HAVE_STRUCT_IO_CQRING_OFFSETS_FLAGS
-+ printflags(uring_cqring_flags,
-+ params->cq_off.flags,
-+ "IORING_CQ_???");
-+ if (params->cq_off.resv1)
-+ printf(", resv1=%#x", params->cq_off.resv1);
-+ if (params->cq_off.resv2)
-+ printf(", resv2=%#llx",
- (unsigned long long)
-- params->cq_off.resv[0],
-+ params->cq_off.resv2);
-+#else
-+ union {
-+ struct {
-+ uint32_t flags;
-+ uint32_t resv1;
-+ } s;
-+ uint64_t v;
-+ } u = { .v = params->cq_off.resv[0] };
-+ printflags(uring_cqring_flags, u.s.flags,
-+ "IORING_CQ_???");
-+ if (u.s.resv1)
-+ printf(", resv1=%#x", u.s.resv1);
-+ if (params->cq_off.resv[1])
-+ printf(", resv2=%#llx",
- (unsigned long long)
- params->cq_off.resv[1]);
-- }
-+#endif
-
- printf("}}) = %ld<anon_inode:[io_uring]>\n", rc);
- }
-diff --git a/types/io_uring.h b/types/io_uring.h
-index 76f432c3..2fe1c13a 100644
---- a/types/io_uring.h
-+++ b/types/io_uring.h
-@@ -31,7 +31,9 @@ typedef struct {
- uint32_t ring_entries;
- uint32_t overflow;
- uint32_t cqes;
-- uint64_t resv[2];
-+ /** Added by v5.8-rc1~190^2~22 */ uint32_t flags;
-+ /** Added by v5.8-rc1~190^2~22 */ uint32_t resv1;
-+ /** Added by v5.8-rc1~190^2~22 */ uint64_t resv2;
- } struct_io_cqring_offsets;
-
- typedef struct {
-diff --git a/xlat/uring_cqring_flags.h b/xlat/uring_cqring_flags.h
-new file mode 100644
-index 00000000..7c06c35c
---- /dev/null
-+++ b/xlat/uring_cqring_flags.h
-@@ -0,0 +1,48 @@
-+/* Generated by ./gen.sh from ./uring_cqring_flags.in; do not edit. */
-+
-+#include "gcc_compat.h"
-+#include "static_assert.h"
-+
-+#if defined(IORING_CQ_EVENTFD_DISABLED) || (defined(HAVE_DECL_IORING_CQ_EVENTFD_DISABLED) && HAVE_DECL_IORING_CQ_EVENTFD_DISABLED)
-+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
-+static_assert((IORING_CQ_EVENTFD_DISABLED) == (1U), "IORING_CQ_EVENTFD_DISABLED != 1U");
-+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
-+#else
-+# define IORING_CQ_EVENTFD_DISABLED 1U
-+#endif
-+
-+#ifndef XLAT_MACROS_ONLY
-+
-+# ifdef IN_MPERS
-+
-+# error static const struct xlat uring_cqring_flags in mpers mode
-+
-+# else
-+
-+static const struct xlat_data uring_cqring_flags_xdata[] = {
-+ XLAT(IORING_CQ_EVENTFD_DISABLED),
-+ #define XLAT_VAL_0 ((unsigned) (IORING_CQ_EVENTFD_DISABLED))
-+ #define XLAT_STR_0 STRINGIFY(IORING_CQ_EVENTFD_DISABLED)
-+};
-+static
-+const struct xlat uring_cqring_flags[1] = { {
-+ .data = uring_cqring_flags_xdata,
-+ .size = ARRAY_SIZE(uring_cqring_flags_xdata),
-+ .type = XT_NORMAL,
-+ .flags_mask = 0
-+# ifdef XLAT_VAL_0
-+ | XLAT_VAL_0
-+# endif
-+ ,
-+ .flags_strsz = 0
-+# ifdef XLAT_STR_0
-+ + sizeof(XLAT_STR_0)
-+# endif
-+ ,
-+} };
-+
-+# undef XLAT_STR_0
-+# undef XLAT_VAL_0
-+# endif /* !IN_MPERS */
-+
-+#endif /* !XLAT_MACROS_ONLY */
-diff --git a/xlat/uring_cqring_flags.in b/xlat/uring_cqring_flags.in
-new file mode 100644
-index 00000000..c81fbc20
---- /dev/null
-+++ b/xlat/uring_cqring_flags.in
-@@ -0,0 +1 @@
-+IORING_CQ_EVENTFD_DISABLED 1U
---
-2.28.0
-