Thread (9 messages) 9 messages, 3 authors, 2019-01-16

Re: [PATCH 05/16] Add io_uring IO interface

flat view

From: Arnd Bergmann <arnd@arndb.de>
Date: 2019-01-16 11:00:40
Also in: linux-arch, linux-fsdevel

Possibly related (same subject, not in this thread)

On Wed, Jan 16, 2019 at 11:41 AM Arnd Bergmann [off-list ref] wrote:
quoted
+/*
+ * IO submission data structure (Submission Queue Entry)
+ */
+struct io_uring_sqe {
+       __u8    opcode;         /* type of operation for this sqe */
+       __u8    flags;          /* as of now unused */
+       __u16   ioprio;         /* ioprio for the request */
+       __s32   fd;             /* file descriptor to do IO on */
+       __u64   off;            /* offset into file */
+       union {
+               void    *addr;  /* buffer or iovecs */
+               __u64   __pad;
+       };
It seems a bit unfortunate to keep the pointer field only
almost compatible between 32-bit and 64-bit big-endian
architectures, as that requires an in_compat_syscall()
check whenever we access the pointer from the kernel.

Could you use a __u64 field to store the pointer itself
instead?
To clarify: Using the u64_to_user_ptr() helper function,
you can interpret a __u64 field in a uapi data structure
directly as a pointer. The user space side needs a similar
wrapper though.

     Arnd
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help