History

Merge tag 'io_uring-5.10-2020-10-12' of git://git.kernel.dk/linux-block

Pull io_uring updates from Jens Axboe: - Add blkcg accounting for io-wq offload (Dennis) - A use-after-free fix for io-wq (Hillf) - Cancelation fixes and improvements - Use proper files_struct references for offload - Cleanup of io_uring_get_socket() since that can now go into our own header - SQPOLL fixes and cleanups, and support for sharing the thread - Improvement to how page accounting is done for registered buffers and huge pages, accounting the real pinned state - Series cleaning up the xarray code (Willy) - Various cleanups, refactoring, and improvements (Pavel) - Use raw spinlock for io-wq (Sebastian) - Add support for ring restrictions (Stefano) * tag 'io_uring-5.10-2020-10-12' of git://git.kernel.dk/linux-block: (62 commits) io_uring: keep a pointer ref_node in file_data io_uring: refactor *files_register()'s error paths io_uring: clean file_data access in files_register io_uring: don't delay io_init_req() error check io_uring: clean leftovers after splitting issue io_uring: remove timeout.list after hrtimer cancel io_uring: use a separate struct for timeout_remove io_uring: improve submit_state.ios_left accounting io_uring: simplify io_file_get() io_uring: kill extra check in fixed io_file_get() io_uring: clean up ->files grabbing io_uring: don't io_prep_async_work() linked reqs io_uring: Convert advanced XArray uses to the normal API io_uring: Fix XArray usage in io_uring_add_task_file io_uring: Fix use of XArray in __io_uring_files_cancel io_uring: fix break condition for __io_uring_register() waiting io_uring: no need to call xa_destroy() on empty xarray io_uring: batch account ->req_issue and task struct references io_uring: kill callback_head argument for io_req_task_work_add() io_uring: move req preps out of io_issue_sqe() ...

Linus Torvalds committed 6 years ago

Commit 6ad4bf62 parents 3ad11d7 b2e968512 files · +1662 −911Browse files

Showing the changes to include/uapi (1 of 12 files). Show all

Unified · Split

include/uapi/linux/io_uring.h+50−11
@@ -95,6 +95,7 @@ enum { · 94 unmodified lines
9595 #define IORING_SETUP_CQSIZE (1U << 3) /* app defines CQ size */
9696 #define IORING_SETUP_CLAMP (1U << 4) /* clamp SQ/CQ ring sizes */
9797 #define IORING_SETUP_ATTACH_WQ (1U << 5) /* attach to existing wq */
98+#define IORING_SETUP_R_DISABLED (1U << 6) /* start with ring disabled */
9899
99100 enum {
100101 IORING_OP_NOP,
@@ -224,6 +225,7 @@ struct io_cqring_offsets { · 123 unmodified lines
224225 */
225226 #define IORING_ENTER_GETEVENTS (1U << 0)
226227 #define IORING_ENTER_SQ_WAKEUP (1U << 1)
228+#define IORING_ENTER_SQ_WAIT (1U << 2)
227229
228230 /*
229231 * Passed in for io_uring_setup(2). Copied back with updated info on success
@@ -255,17 +257,24 @@ struct io_uring_params { · 25 unmodified lines
255257 /*
256258 * io_uring_register(2) opcodes and arguments
257259 */
258−#define IORING_REGISTER_BUFFERS 0
259−#define IORING_UNREGISTER_BUFFERS 1
260−#define IORING_REGISTER_FILES 2
261−#define IORING_UNREGISTER_FILES 3
262−#define IORING_REGISTER_EVENTFD 4
263−#define IORING_UNREGISTER_EVENTFD 5
264−#define IORING_REGISTER_FILES_UPDATE 6
265−#define IORING_REGISTER_EVENTFD_ASYNC 7
266−#define IORING_REGISTER_PROBE 8
267−#define IORING_REGISTER_PERSONALITY 9
268−#define IORING_UNREGISTER_PERSONALITY 10
260+enum {
261+ IORING_REGISTER_BUFFERS = 0,
262+ IORING_UNREGISTER_BUFFERS = 1,
263+ IORING_REGISTER_FILES = 2,
264+ IORING_UNREGISTER_FILES = 3,
265+ IORING_REGISTER_EVENTFD = 4,
266+ IORING_UNREGISTER_EVENTFD = 5,
267+ IORING_REGISTER_FILES_UPDATE = 6,
268+ IORING_REGISTER_EVENTFD_ASYNC = 7,
269+ IORING_REGISTER_PROBE = 8,
270+ IORING_REGISTER_PERSONALITY = 9,
271+ IORING_UNREGISTER_PERSONALITY = 10,
272+ IORING_REGISTER_RESTRICTIONS = 11,
273+ IORING_REGISTER_ENABLE_RINGS = 12,
274+
275+ /* this goes last */
276+ IORING_REGISTER_LAST
277+};
269278
270279 struct io_uring_files_update {
271280 __u32 offset;
@@ -290,4 +299,34 @@ struct io_uring_probe { · 18 unmodified lines
290299 struct io_uring_probe_op ops[0];
291300 };
292301
302+struct io_uring_restriction {
303+ __u16 opcode;
304+ union {
305+ __u8 register_op; /* IORING_RESTRICTION_REGISTER_OP */
306+ __u8 sqe_op; /* IORING_RESTRICTION_SQE_OP */
307+ __u8 sqe_flags; /* IORING_RESTRICTION_SQE_FLAGS_* */
308+ };
309+ __u8 resv;
310+ __u32 resv2[3];
311+};
312+
313+/*
314+ * io_uring_restriction->opcode values
315+ */
316+enum {
317+ /* Allow an io_uring_register(2) opcode */
318+ IORING_RESTRICTION_REGISTER_OP = 0,
319+
320+ /* Allow an sqe opcode */
321+ IORING_RESTRICTION_SQE_OP = 1,
322+
323+ /* Allow sqe flags */
324+ IORING_RESTRICTION_SQE_FLAGS_ALLOWED = 2,
325+
326+ /* Require sqe flags (these flags must be set on each submission) */
327+ IORING_RESTRICTION_SQE_FLAGS_REQUIRED = 3,
328+
329+ IORING_RESTRICTION_LAST
330+};
331+
293332 #endif