summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2020-12-15 06:14:08 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2020-12-15 23:13:46 +0300
commitd9f411bacfa0c3d0d97580a66f88e70f92bcf58e (patch)
treec4afeb82fdc6d12126d9b60752c315e913547efb
parent1e17a24edf9bef891bbdd02617eaab4fa6efcd7f (diff)
downloadlinux-d9f411bacfa0c3d0d97580a66f88e70f92bcf58e.tar.xz
userfaultfd/selftests: hint the test runner on required privilege
Now userfaultfd test program requires either root or ptrace privilege due to the signal/event tests. When UFFDIO_API failed, hint the test runner about this fact verbosely. Link: https://lkml.kernel.org/r/20201208024709.7701-4-peterx@redhat.com Signed-off-by: Peter Xu <peterx@redhat.com> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--tools/testing/selftests/vm/userfaultfd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/testing/selftests/vm/userfaultfd.c b/tools/testing/selftests/vm/userfaultfd.c
index 6e482e2f198c..9d8650d4ba5a 100644
--- a/tools/testing/selftests/vm/userfaultfd.c
+++ b/tools/testing/selftests/vm/userfaultfd.c
@@ -794,7 +794,8 @@ static int userfaultfd_open(int features)
uffdio_api.api = UFFD_API;
uffdio_api.features = features;
if (ioctl(uffd, UFFDIO_API, &uffdio_api)) {
- fprintf(stderr, "UFFDIO_API\n");
+ fprintf(stderr, "UFFDIO_API failed.\nPlease make sure to "
+ "run with either root or ptrace capability.\n");
return 1;
}
if (uffdio_api.api != UFFD_API) {