Axel Rasmussen
f619147104
userfaultfd: add UFFDIO_CONTINUE ioctl
This ioctl is how userspace ought to resolve "minor" userfaults. The
idea is, userspace is notified that a minor fault has occurred. It
might change the contents of the page using its second non-UFFD mapping,
or not. Then, it calls UFFDIO_CONTINUE to tell the kernel "I have
ensured the page contents are correct, carry on setting up the mapping".
Note that it doesn't make much sense to use UFFDIO_{COPY,ZEROPAGE} for
MINOR registered VMAs. ZEROPAGE maps the VMA to the zero page; but in
the minor fault case, we already have some pre-existing underlying page.
Likewise, UFFDIO_COPY isn't useful if we have a second non-UFFD mapping.
We'd just use memcpy() or similar instead.
It turns out hugetlb_mcopy_atomic_pte() already does very close to what
we want, if an existing page is provided via `struct page **pagep`. We
already special-case the behavior a bit for the UFFDIO_ZEROPAGE case, so
just extend that design: add an enum for the three modes of operation,
and make the small adjustments needed for the MCOPY_ATOMIC_CONTINUE
case. (Basically, look up the existing page, and avoid adding the
existing page to the page cache or calling set_page_huge_active() on
it.)
Link: https://lkml.kernel.org/r/20210301222728.176417-5-axelrasmussen@google.com
Signed-off-by: Axel Rasmussen <axelrasmussen@google.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Cc: Adam Ruprecht <ruprecht@google.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Cannon Matthews <cannonmatthews@google.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Chinwen Chang <chinwen.chang@mediatek.com>
Cc: David Rientjes <rientjes@google.com>
Cc: "Dr . David Alan Gilbert" <dgilbert@redhat.com>
Cc: Huang Ying <ying.huang@intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jann Horn <jannh@google.com>
Cc: Jerome Glisse <jglisse@redhat.com>
Cc: Kirill A. Shutemov <kirill@shutemov.name>
Cc: Lokesh Gidra <lokeshgidra@google.com>
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: "Michal Koutn" <mkoutny@suse.com>
Cc: Michel Lespinasse <walken@google.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
Cc: Mina Almasry <almasrymina@google.com>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Oliver Upton <oupton@google.com>
Cc: Shaohua Li <shli@fb.com>
Cc: Shawn Anastasio <shawn@anastas.io>
Cc: Steven Price <steven.price@arm.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-05-05 11:27:22 -07:00
..
2021-04-26 16:32:11 -07:00
2021-04-22 09:26:22 -07:00
2021-03-30 11:14:45 +02:00
2021-02-16 12:09:52 +01:00
2021-03-24 14:01:58 +01:00
2021-02-09 12:26:40 +01:00
2021-02-01 11:29:11 +05:30
2021-04-27 14:10:15 -07:00
2021-04-26 12:11:52 -07:00
2021-04-06 15:33:32 -05:00
2021-03-08 11:59:17 +01:00
2021-02-02 00:16:57 +01:00
2021-04-07 08:36:38 +01:00
2021-04-26 12:30:36 -07:00
2021-04-28 15:59:13 -07:00
2021-04-24 00:58:43 -07:00
2021-04-23 09:29:49 +02:00
2021-04-16 20:30:54 +02:00
2021-04-26 18:16:56 +02:00
2021-04-26 18:16:56 +02:00
2021-04-26 03:20:07 +02:00
2021-04-26 18:16:56 +02:00
2021-04-26 18:16:56 +02:00
2021-03-15 12:53:12 -07:00
2021-03-17 12:13:19 +05:30
2021-04-29 11:57:23 -07:00
2021-03-21 21:29:26 +01:00
2021-04-08 13:26:22 -07:00
2021-04-23 13:18:35 +01:00
2021-04-29 11:06:13 -07:00
2021-03-29 22:49:54 -05:00
2021-04-06 10:22:02 +05:30
2021-04-28 15:56:51 -07:00
2021-02-08 13:23:42 +02:00
2021-03-31 15:57:48 -04:00
2021-03-08 11:33:28 +01:00
2021-04-29 11:57:23 -07:00
2021-04-26 17:04:27 +02:00
2021-03-22 08:55:28 +05:30
2021-04-09 14:54:23 -07:00
2021-04-14 16:30:30 +03:00
2021-03-08 15:16:30 -08:00
2021-03-08 10:21:11 -05:00
2021-04-12 09:19:58 -06:00
2021-02-26 09:41:04 -08:00
2021-02-08 08:33:16 -07:00
2021-03-04 17:36:59 -05:00
2021-04-28 14:39:37 -07:00
2021-02-23 09:54:51 -07:00
2021-03-17 16:34:11 +01:00
2021-02-26 11:51:48 -08:00
2021-02-26 11:51:47 -08:00
2021-02-26 12:28:03 -08:00
2021-04-13 18:18:57 -07:00
2021-04-03 01:43:49 +02:00
2021-04-29 11:57:23 -07:00
2021-02-16 15:23:23 -08:00
2021-03-26 20:41:51 -07:00
2021-02-26 09:41:03 -08:00
2021-04-08 16:04:20 -07:00
2021-04-04 13:34:46 -04:00
2021-02-17 14:07:48 +01:00
2021-04-07 11:05:44 -07:00
2021-02-22 09:45:23 -08:00
2021-03-22 23:06:48 +01:00
2021-04-23 09:03:16 +02:00
2021-02-14 18:15:15 +00:00
2021-04-08 16:04:20 -07:00
2021-04-08 16:04:20 -07:00
2021-04-30 11:20:35 -07:00
2021-04-25 05:26:10 +09:00
2021-03-08 10:21:11 -05:00
2021-02-11 18:31:48 +01:00
2021-02-04 17:00:32 +01:00
2021-03-10 09:16:09 +01:00
2021-02-04 19:25:47 +01:00
2021-04-26 12:30:36 -07:00
2021-04-07 19:26:44 +02:00
2021-04-29 11:41:43 -07:00
2021-03-22 15:23:32 -04:00
2021-04-16 17:06:34 +02:00
2021-03-09 15:40:16 +09:00
2021-03-22 12:32:31 -04:00
2021-03-23 14:58:10 +01:00
2021-04-22 08:20:15 +02:00
2021-04-08 12:21:13 +02:00
2021-02-25 18:28:24 +05:30
2021-02-24 09:54:24 -08:00
2021-02-26 13:59:32 -08:00
2021-02-04 14:42:00 +01:00
2021-03-19 07:44:28 +01:00
2021-04-25 05:25:42 +09:00
2021-03-22 03:57:39 +01:00
2021-02-17 14:12:43 +01:00
2021-03-14 14:48:02 -07:00
2021-04-16 16:59:20 -07:00
2021-02-16 09:59:41 +01:00
2021-02-08 12:28:07 +01:00
2021-01-30 11:47:12 -05:00
2021-03-15 11:09:38 +09:00
2021-01-27 15:20:02 -08:00
2021-03-16 16:55:05 +01:00
2021-03-12 15:10:03 +01:00
2021-04-12 15:04:23 +02:00
2021-03-30 22:37:06 +02:00
2021-02-26 09:41:04 -08:00
2021-04-08 19:12:20 +02:00
2021-05-05 11:27:20 -07:00
2021-04-23 10:14:32 +01:00
2021-04-23 10:14:32 +01:00
2021-03-16 16:49:31 +01:00
2021-02-07 14:51:11 -08:00
2021-02-09 12:43:42 -05:00
2021-02-24 10:13:55 -08:00
2021-04-08 10:24:36 -06:00
2021-04-30 11:20:43 -07:00
2021-03-17 16:34:08 +01:00
2021-02-23 19:26:43 +01:00
2021-03-11 20:47:09 +00:00
2021-03-11 20:47:09 +00:00
2021-01-26 14:24:26 +01:00
2021-02-24 13:38:32 -08:00
2021-02-11 19:56:15 +01:00
2021-03-30 19:37:20 +02:00
2021-05-05 11:27:21 -07:00
2021-03-25 09:22:55 -07:00
2021-05-05 11:27:22 -07:00
2021-04-28 17:22:10 -07:00
2021-02-23 11:29:52 -08:00
2021-04-19 12:50:15 +02:00
2021-03-23 14:49:05 -07:00
2021-02-11 13:24:44 -08:00
2021-03-10 15:20:24 -08:00
2021-03-15 20:41:58 -07:00
2021-02-23 13:39:45 -08:00
2021-02-16 13:14:06 -08:00
2021-04-08 16:04:20 -07:00
2021-02-18 23:17:57 -08:00
2021-04-08 19:09:02 +02:00
2021-02-04 14:42:00 +01:00
2021-03-17 16:34:07 +01:00
2021-04-11 19:30:41 -06:00
2021-04-30 11:20:39 -07:00
2021-02-12 15:27:17 +01:00
2021-04-30 11:20:40 -07:00
2021-02-21 10:29:20 -08:00
2021-02-12 15:27:17 +01:00
2021-04-26 15:03:23 -07:00
2021-01-27 12:27:36 +01:00
2021-02-23 11:29:52 -08:00
2021-04-26 10:25:03 -07:00
2021-03-22 04:23:14 +01:00
2021-04-22 15:55:22 +01:00
2021-01-26 07:42:27 +01:00
2021-04-08 14:05:19 +02:00
2021-02-08 12:24:04 +01:00
2021-02-24 13:38:31 -08:00
2021-04-30 11:20:41 -07:00
2021-03-11 14:40:50 +09:00
2021-03-06 12:40:21 +01:00
2021-03-08 14:27:43 -08:00
2021-03-08 14:27:43 -08:00
2021-02-17 14:12:42 +01:00
2021-03-08 12:06:29 -07:00
2021-02-22 10:22:54 -08:00
2021-02-26 09:41:02 -08:00
2021-02-26 09:41:05 -08:00
2021-02-26 09:40:59 -08:00
2021-03-08 11:43:35 +01:00
2021-01-29 15:39:48 -05:00
2021-02-26 09:41:03 -08:00
2021-02-22 13:16:53 -05:00
2021-02-19 11:54:08 +01:00
2021-02-19 11:54:08 +01:00
2021-02-19 11:35:28 +01:00
2021-04-13 09:16:12 -06:00
2021-04-08 16:04:22 -07:00
2021-04-28 12:37:53 -07:00
2021-03-22 15:23:32 -04:00
2021-03-22 15:23:32 -04:00
2021-04-20 16:27:54 -07:00
2021-04-12 10:36:00 -06:00
2021-04-27 14:13:24 -07:00
2021-02-09 09:30:16 +01:00
2021-03-25 09:22:55 -07:00
2021-04-30 11:20:38 -07:00
2021-02-26 09:41:00 -08:00
2021-02-26 09:41:00 -08:00
2021-02-26 09:41:00 -08:00
2021-04-09 18:48:22 +05:30
2021-02-24 13:38:35 -08:00
2021-04-04 18:29:37 -04:00
2021-02-24 13:38:33 -08:00
2021-03-13 11:27:30 -08:00
2021-05-05 11:27:22 -07:00
2021-03-25 09:22:55 -07:00
2021-04-30 11:20:43 -07:00
2021-02-24 10:25:37 -08:00
2021-04-08 16:04:20 -07:00
2021-02-27 08:07:12 -08:00
2021-04-09 14:54:23 -07:00
2021-01-30 01:22:31 +01:00
2021-03-29 15:56:48 +02:00
2021-04-08 22:18:36 -07:00
2021-02-23 20:32:11 -07:00
2021-02-11 13:24:44 -08:00
2021-04-07 14:43:28 -07:00
2021-01-25 22:06:11 +01:00
2021-04-23 10:14:32 +01:00
2021-04-19 15:41:28 -07:00
2021-03-22 15:01:45 -04:00
2021-02-26 09:17:24 -08:00
2021-03-22 10:19:00 -04:00
2021-04-06 08:34:39 +02:00
2021-04-02 16:26:33 +02:00
2021-01-26 11:12:00 -06:00
2021-02-12 19:23:57 -06:00
2021-02-11 08:33:41 +01:00
2021-02-17 13:17:49 -08:00
2021-04-13 14:35:02 -07:00
2021-04-21 10:24:41 -05:00
2021-04-26 08:51:23 -07:00
2021-04-01 14:07:41 -07:00
2021-02-24 13:38:29 -08:00
2021-04-30 11:20:42 -07:00
2021-02-26 09:41:01 -08:00
2021-05-05 11:27:19 -07:00
2021-02-26 09:40:59 -08:00
2021-04-30 11:20:41 -07:00
2021-03-10 12:46:04 +00:00
2021-02-03 19:05:50 +01:00
2021-03-10 09:34:06 +01:00
2021-02-23 14:11:13 -06:00
2021-02-23 14:12:01 -06:00
2021-04-29 11:57:23 -07:00
2021-04-19 20:03:29 +02:00
2021-03-10 10:56:46 +00:00
2021-04-20 16:08:02 -07:00
2021-03-15 12:53:12 -07:00
2021-04-02 17:02:31 +02:00
2021-02-24 14:52:41 +01:00
2021-03-16 10:14:11 +05:30
2021-04-08 19:14:46 +02:00
2021-04-07 19:18:23 +02:00
2021-01-27 17:44:18 -08:00
2021-04-28 15:43:58 -07:00
2021-03-24 12:48:38 -07:00
2021-03-17 16:34:08 +01:00
2021-04-05 13:18:22 +02:00
2021-03-06 12:40:22 +01:00
2021-03-06 12:40:22 +01:00
2021-02-04 05:27:20 -05:00
2021-03-12 17:09:34 -08:00
2021-02-26 09:41:03 -08:00
2021-04-12 14:49:31 +02:00
2021-04-08 14:05:19 +02:00
2021-02-17 14:07:44 +01:00
2021-03-15 13:54:54 -07:00
2021-03-08 14:17:35 -08:00
2021-04-28 12:00:13 -07:00
2021-03-24 17:16:15 -07:00
2021-03-22 08:23:48 -07:00
2021-03-31 13:53:38 +01:00
2021-01-25 17:32:10 +01:00
2021-03-16 22:13:11 +01:00
2021-02-26 09:41:01 -08:00
2021-03-29 15:57:03 +02:00
2021-02-04 05:27:42 -05:00
2021-03-22 02:45:52 +01:00
2021-03-18 22:39:30 -04:00
2021-04-30 11:20:36 -07:00
2021-03-30 16:35:16 +01:00
2021-03-22 15:23:32 -04:00
2021-04-27 15:50:15 -07:00
2021-03-10 09:51:45 +01:00
2021-04-22 12:04:26 +02:00
2021-03-10 09:34:10 +01:00
2021-04-11 16:34:56 -07:00
2021-04-28 13:33:57 -07:00
2021-04-01 10:56:13 -07:00
2021-04-25 18:02:32 -07:00
2021-02-26 09:41:02 -08:00
2021-03-08 14:18:46 -08:00
2021-02-26 09:41:02 -08:00
2021-03-06 12:59:10 +01:00
2021-04-26 13:04:19 -07:00
2021-02-26 09:41:04 -08:00
2021-03-10 15:52:31 +01:00
2021-04-19 16:03:15 +02:00
2021-03-11 16:04:39 +01:00
2021-04-28 12:37:53 -07:00
2021-04-22 15:02:40 -07:00
2021-03-13 11:27:30 -08:00
2021-02-26 09:41:04 -08:00
2021-03-02 17:25:46 -07:00
2021-02-20 10:13:32 -05:00
2021-03-17 15:51:17 +01:00
2021-03-25 17:39:33 -07:00
2021-04-11 19:30:25 -06:00
2021-02-02 14:50:15 +01:00
2021-03-01 15:25:24 -08:00
2021-03-16 22:13:10 +01:00
2021-03-18 18:25:31 +03:00
2021-04-16 21:03:50 +02:00
2021-03-22 23:06:48 +01:00
2021-01-27 17:26:42 +01:00
2021-04-14 16:30:30 +03:00
2021-03-04 09:51:50 -05:00
2021-02-02 17:02:05 -05:00
2021-02-09 12:27:29 -05:00
2021-04-10 10:36:34 +02:00
2021-03-10 09:34:06 +01:00
2021-04-15 10:32:17 +02:00
2021-02-13 17:17:53 +01:00
2021-03-10 09:51:45 +01:00
2021-03-30 17:06:49 -07:00
2021-04-26 22:55:12 +01:00
2021-02-15 18:50:01 +01:00
2021-03-17 21:30:15 +01:00
2021-04-09 16:00:00 +02:00
2021-04-29 11:06:13 -07:00
2021-05-05 11:27:22 -07:00
2021-03-19 22:23:19 +01:00
2021-02-25 14:26:00 -05:00
2021-04-06 11:55:11 -06:00
2021-03-22 15:02:14 +01:00
2021-04-06 16:17:57 -07:00
2021-02-23 07:52:58 -05:00
2021-03-14 04:37:35 -04:00
2021-04-30 11:20:40 -07:00
2021-02-09 12:15:07 +01:00
2021-04-30 11:20:37 -07:00
2021-01-26 19:18:50 +01:00
2021-03-08 11:33:39 +01:00
2021-03-19 12:13:10 +01:00
2021-04-16 15:31:02 -07:00
2021-03-30 13:42:33 -04:00
2021-02-26 09:41:01 -08:00
2021-02-26 09:41:01 -08:00
2021-02-08 22:58:55 +01:00