]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
selftests/mm: add uffdio register ioctls test
authorPeter Xu <peterx@redhat.com>
Wed, 12 Apr 2023 16:45:48 +0000 (12:45 -0400)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 18 Apr 2023 23:30:08 +0000 (16:30 -0700)
commit43759d44dc346273efd79e99ba5d195ed6c2bfa2
treeb6084354fbb71fe67844c35a5e534b6ea4bb47a6
parent5aec236fdd69d39f9fa5e579d10f7a45ed11b005
selftests/mm: add uffdio register ioctls test

This new test tests against the returned ioctls from UFFDIO_REGISTER,
where put into uffdio_register.ioctls.

This also tests the expected failure cases of UFFDIO_REGISTER, aka:

  - Register with empty mode should fail with -EINVAL
  - Register minor without page cache (anon) should fail with -EINVAL

Link: https://lkml.kernel.org/r/20230412164548.329376-1-peterx@redhat.com
Signed-off-by: Peter Xu <peterx@redhat.com>
Cc: Axel Rasmussen <axelrasmussen@google.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Dmitry Safonov <0x7f454c46@gmail.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Mike Rapoport (IBM) <rppt@kernel.org>
Cc: Zach O'Keefe <zokeefe@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
tools/testing/selftests/mm/uffd-unit-tests.c