userfaultfd: shmem: allow registration of shared memory ranges

Expand the userfaultfd_register/unregister routines to allow shared
memory VMAs.

Currently, there is no UFFDIO_ZEROPAGE and write-protection support for
shared memory VMAs, which is reflected in ioctl methods supported by
uffdio_register.

Link: http://lkml.kernel.org/r/20161216144821.5183-34-aarcange@redhat.com
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Cc: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Cc: Hillf Danton <hillf.zj@alibaba-inc.com>
Cc: Michael Rapoport <RAPOPORT@il.ibm.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Mike Rapoport 2017-02-22 15:43:40 -08:00 committed by Linus Torvalds
parent cfda05267f
commit cac673292b
3 changed files with 9 additions and 16 deletions

View file

@ -129,7 +129,7 @@ static void allocate_area(void **alloc_area)
#else /* HUGETLB_TEST */
#define EXPECTED_IOCTLS UFFD_API_RANGE_IOCTLS_HPAGE
#define EXPECTED_IOCTLS UFFD_API_RANGE_IOCTLS_BASIC
static int release_pages(char *rel_area)
{