* [LTP] [PATCH] userfaultfd: Do not use min_kver as gate for test
@ 2026-01-28 11:54 Ricardo Branco
2026-01-28 12:50 ` Petr Vorel
0 siblings, 1 reply; 2+ messages in thread
From: Ricardo Branco @ 2026-01-28 11:54 UTC (permalink / raw)
To: ltp
Do not use .min_kver to decide whether the test should run and instead
check for the presence of /dev/userfaultfd at runtime.
Signed-off-by: Ricardo Branco <rbranco@suse.de>
---
.../kernel/syscalls/userfaultfd/userfaultfd03.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/testcases/kernel/syscalls/userfaultfd/userfaultfd03.c b/testcases/kernel/syscalls/userfaultfd/userfaultfd03.c
index ba87bf6e4..d6e1897db 100644
--- a/testcases/kernel/syscalls/userfaultfd/userfaultfd03.c
+++ b/testcases/kernel/syscalls/userfaultfd/userfaultfd03.c
@@ -13,6 +13,7 @@
#include "config.h"
#include <poll.h>
+#include <unistd.h>
#include "tst_test.h"
#include "tst_safe_macros.h"
#include "tst_safe_pthread.h"
@@ -23,6 +24,17 @@ static char *page;
static void *copy_page;
static int uffd;
+static void setup(void)
+{
+ if (access("/dev/userfaultfd", F_OK) == 0)
+ return;
+
+ if (tst_kvercmp(6, 1, 0) < 0)
+ tst_brk(TCONF, "/dev/userfaultfd is missing (kernel < 6.1)");
+
+ tst_brk(TBROK, "/dev/userfaultfd is missing (kernel >= 6.1)");
+}
+
static int open_userfaultfd(int flags)
{
int fd, fd2;
@@ -117,6 +129,6 @@ static void run(void)
static struct tst_test test = {
.needs_root = 1,
+ .setup = setup,
.test_all = run,
- .min_kver = "5.11",
};
--
2.52.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [LTP] [PATCH] userfaultfd: Do not use min_kver as gate for test
2026-01-28 11:54 [LTP] [PATCH] userfaultfd: Do not use min_kver as gate for test Ricardo Branco
@ 2026-01-28 12:50 ` Petr Vorel
0 siblings, 0 replies; 2+ messages in thread
From: Petr Vorel @ 2026-01-28 12:50 UTC (permalink / raw)
To: Ricardo Branco; +Cc: ltp
Hi all,
> Do not use .min_kver to decide whether the test should run and instead
> check for the presence of /dev/userfaultfd at runtime.
FYI Ricardo continue this effort in GH PR [1], thus close this in patchwork.
Kind regards,
Petr
[1] https://github.com/linux-test-project/ltp/pull/1285
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-01-28 12:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-28 11:54 [LTP] [PATCH] userfaultfd: Do not use min_kver as gate for test Ricardo Branco
2026-01-28 12:50 ` Petr Vorel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox