• Peter Xu's avatar
    userfaultfd/selftests: use user mode only · d2c6c06f
    Peter Xu authored
    Patch series "userfaultfd/selftests: A few cleanups", v2.
    
    I wanted to cleanup userfaultfd.c fault handling for a long time.  If it's
    not cleaned, when the new code grows the file it'll also grow the size
    that needs to be cleaned...  This is my attempt to cleanup the userfaultfd
    selftest on fault handling, to use an err() macro instead of either
    fprintf() or perror() then another exit() call.
    
    The huge cleanup is done in the last patch.  The first 4 patches are some
    other standalone cleanups for the same file, so I put them together.
    
    This patch (of 5):
    
    Userfaultfd selftest does not need to handle kernel initiated fault.  Set
    user mode so it can be run even if unprivileged_userfaultfd=0 (which is
    the default).
    
    Link: https://lkml.kernel.org/r/20210412232753.1012412-2-peterx@redhat.comSigned-off-by: default avatarPeter Xu <peterx@redhat.com>
    Reviewed-by: default avatarAxel Rasmussen <axelrasmussen@google.com>
    Cc: Andrea Arcangeli <aarcange@redhat.com>
    Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
    Cc: Alexander Viro <viro@zeniv.linux.org.uk>
    Cc: Brian Geffon <bgeffon@google.com>
    Cc: "Dr . David Alan Gilbert" <dgilbert@redhat.com>
    Cc: Hugh Dickins <hughd@google.com>
    Cc: Jerome Glisse <jglisse@redhat.com>
    Cc: Joe Perches <joe@perches.com>
    Cc: Kirill A. Shutemov <kirill@shutemov.name>
    Cc: Lokesh Gidra <lokeshgidra@google.com>
    Cc: Mike Kravetz <mike.kravetz@oracle.com>
    Cc: Mina Almasry <almasrymina@google.com>
    Cc: Oliver Upton <oupton@google.com>
    Cc: Shaohua Li <shli@fb.com>
    Cc: Shuah Khan <shuah@kernel.org>
    Cc: Stephen Rothwell <sfr@canb.auug.org.au>
    Cc: Wang Qing <wangqing@vivo.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    d2c6c06f
userfaultfd.c 42.3 KB