Revert "BACKPORT: FROMGIT: userfaultfd: support minor fault handling for shmem"

This reverts commit 0309b3f479b967acb644f99d214e2b25297a20b1
as an updated version of the patch-set will be merged later.

Signed-off-by: Lokesh Gidra <[email protected]>
Bug: 187930641
Change-Id: I765fe86a2dc0305482a0590c14143dee27840b8a
This commit is contained in:
Lokesh Gidra 2021-05-17 00:18:48 -07:00 • committed by Michael Bestas
commit 20c5c31e6e
6 changed files with 87 additions and 84 deletions

View file

@ -1305,7 +1305,8 @@ static inline bool vma_can_userfault(struct vm_area_struct *vma,
unsigned long vm_flags)
{
if (vm_flags & VM_UFFD_MINOR) {
if (!(is_vm_hugetlb_page(vma) || vma_is_shmem(vma)))
/* FIXME: Add minor fault interception for shmem. */
if (!is_vm_hugetlb_page(vma))
return false;
}
@ -1939,8 +1940,7 @@ static int userfaultfd_api(struct userfaultfd_ctx *ctx,
/* report all available features and ioctls to userland */
uffdio_api.features = UFFD_API_FEATURES;
#ifndef CONFIG_HAVE_ARCH_USERFAULTFD_MINOR
uffdio_api.features &=
~(UFFD_FEATURE_MINOR_HUGETLBFS | UFFD_FEATURE_MINOR_SHMEM);
uffdio_api.features &= ~UFFD_FEATURE_MINOR_HUGETLBFS;
#endif
uffdio_api.ioctls = UFFD_API_IOCTLS;
ret = -EFAULT;