* [LTP] [PATCH] userfaultfd03.c: Require kernel 6.1
@ 2026-03-26 12:52 Petr Vorel
2026-03-26 21:35 ` Ricardo Branco
2026-03-27 5:41 ` Li Wang via ltp
0 siblings, 2 replies; 11+ messages in thread
From: Petr Vorel @ 2026-03-26 12:52 UTC (permalink / raw)
To: ltp
Required kernel functionality was added in kernel 6.1 (not 6.11)
2d5de004e009 ("userfaultfd: add /dev/userfaultfd for fine grained access control")
Because it's a new kernel functionality which has not been backported to
enterprise kernels we can simplify check with just .min_kver.
Fixes: b63ab54aee ("userfaultfd: Do not use min_kver as gate for test")
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Hi all,
@Li I suppose RHEL kernel haven't backport this.
Kind regards,
Petr
testcases/kernel/syscalls/userfaultfd/userfaultfd03.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/testcases/kernel/syscalls/userfaultfd/userfaultfd03.c b/testcases/kernel/syscalls/userfaultfd/userfaultfd03.c
index b65f39ecab..dd4354be6f 100644
--- a/testcases/kernel/syscalls/userfaultfd/userfaultfd03.c
+++ b/testcases/kernel/syscalls/userfaultfd/userfaultfd03.c
@@ -24,15 +24,6 @@ static char *page;
static void *copy_page;
static int uffd;
-static void setup(void)
-{
- if (access("/dev/userfaultfd", F_OK) != 0) {
- int res = (tst_kvercmp(6, 1, 0) < 0) ? TCONF : TBROK;
-
- tst_brk(res, "/dev/userfaultfd not found");
- }
-}
-
static int open_userfaultfd(int flags)
{
int fd, fd2;
@@ -127,8 +118,8 @@ static void run(void)
static struct tst_test test = {
.needs_root = 1,
- .setup = setup,
.test_all = run,
+ .min_kver = "6.1",
.needs_kconfigs = (const char *[]) {
"CONFIG_USERFAULTFD=y",
NULL
--
2.53.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: [LTP] [PATCH] userfaultfd03.c: Require kernel 6.1
2026-03-26 12:52 [LTP] [PATCH] userfaultfd03.c: Require kernel 6.1 Petr Vorel
@ 2026-03-26 21:35 ` Ricardo Branco
2026-03-27 5:41 ` Li Wang via ltp
1 sibling, 0 replies; 11+ messages in thread
From: Ricardo Branco @ 2026-03-26 21:35 UTC (permalink / raw)
To: Petr Vorel, ltp
On 3/26/26 1:52 PM, Petr Vorel wrote:
> Required kernel functionality was added in kernel 6.1 (not 6.11)
> 2d5de004e009 ("userfaultfd: add /dev/userfaultfd for fine grained access control")
>
> Because it's a new kernel functionality which has not been backported to
> enterprise kernels we can simplify check with just .min_kver.
>
> Fixes: b63ab54aee ("userfaultfd: Do not use min_kver as gate for test")
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> Hi all,
>
> @Li I suppose RHEL kernel haven't backport this.
>
> Kind regards,
> Petr
>
> testcases/kernel/syscalls/userfaultfd/userfaultfd03.c | 11 +----------
> 1 file changed, 1 insertion(+), 10 deletions(-)
>
> diff --git a/testcases/kernel/syscalls/userfaultfd/userfaultfd03.c b/testcases/kernel/syscalls/userfaultfd/userfaultfd03.c
> index b65f39ecab..dd4354be6f 100644
> --- a/testcases/kernel/syscalls/userfaultfd/userfaultfd03.c
> +++ b/testcases/kernel/syscalls/userfaultfd/userfaultfd03.c
> @@ -24,15 +24,6 @@ static char *page;
> static void *copy_page;
> static int uffd;
>
> -static void setup(void)
> -{
> - if (access("/dev/userfaultfd", F_OK) != 0) {
> - int res = (tst_kvercmp(6, 1, 0) < 0) ? TCONF : TBROK;
> -
> - tst_brk(res, "/dev/userfaultfd not found");
> - }
> -}
> -
> static int open_userfaultfd(int flags)
> {
> int fd, fd2;
> @@ -127,8 +118,8 @@ static void run(void)
>
> static struct tst_test test = {
> .needs_root = 1,
> - .setup = setup,
> .test_all = run,
> + .min_kver = "6.1",
> .needs_kconfigs = (const char *[]) {
> "CONFIG_USERFAULTFD=y",
> NULL
Reviewed-by: Ricardo Branco <rbranco@suse.de>
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [LTP] [PATCH] userfaultfd03.c: Require kernel 6.1
2026-03-26 12:52 [LTP] [PATCH] userfaultfd03.c: Require kernel 6.1 Petr Vorel
2026-03-26 21:35 ` Ricardo Branco
@ 2026-03-27 5:41 ` Li Wang via ltp
2026-03-27 9:05 ` Petr Vorel
1 sibling, 1 reply; 11+ messages in thread
From: Li Wang via ltp @ 2026-03-27 5:41 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp
On Thu, Mar 26, 2026 at 01:52:15PM +0100, Petr Vorel wrote:
> Required kernel functionality was added in kernel 6.1 (not 6.11)
> 2d5de004e009 ("userfaultfd: add /dev/userfaultfd for fine grained access control")
>
> Because it's a new kernel functionality which has not been backported to
> enterprise kernels we can simplify check with just .min_kver.
>
> Fixes: b63ab54aee ("userfaultfd: Do not use min_kver as gate for test")
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> Hi all,
>
> @Li I suppose RHEL kernel haven't backport this.
Why do you lack confidence in RHEL? haha :)
I have confimed that both RHEL 9 and 10 have backported this
feature (commit 2d5de004e009).
As RHEL 9 is based on an older kernel(5.14) but includes this
backport, changing this to .min_kver = "6.1" will cause the
test to be incorrectly skipped (TCONF) on RHEL 9 systems.
Anyway, back to the topic, what is the point of creating this patch?
Anything I missed?
--
Regards,
Li Wang
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [LTP] [PATCH] userfaultfd03.c: Require kernel 6.1
2026-03-27 5:41 ` Li Wang via ltp
@ 2026-03-27 9:05 ` Petr Vorel
2026-03-27 13:17 ` Cyril Hrubis
0 siblings, 1 reply; 11+ messages in thread
From: Petr Vorel @ 2026-03-27 9:05 UTC (permalink / raw)
To: Li Wang; +Cc: ltp
Hi all,
TL;DR: refusing my patch. I'm sorry for the noise.
> On Thu, Mar 26, 2026 at 01:52:15PM +0100, Petr Vorel wrote:
> > Required kernel functionality was added in kernel 6.1 (not 6.11)
> - int res = (tst_kvercmp(6, 1, 0) < 0) ? TCONF : TBROK;
First of all, I'm sorry. I was somehow blind to see kernel check above as 6.11,
of course it is 6.1. That was the main idea about this patch.
> > 2d5de004e009 ("userfaultfd: add /dev/userfaultfd for fine grained access control")
> > Because it's a new kernel functionality which has not been backported to
> > enterprise kernels we can simplify check with just .min_kver.
> > Fixes: b63ab54aee ("userfaultfd: Do not use min_kver as gate for test")
> > Signed-off-by: Petr Vorel <pvorel@suse.cz>
> > ---
> > Hi all,
> > @Li I suppose RHEL kernel haven't backport this.
> Why do you lack confidence in RHEL? haha :)
Lol :). No, just my bad memory and info being on a different place.
> I have confimed that both RHEL 9 and 10 have backported this
> feature (commit 2d5de004e009).
I'm sorry, I have forgotten it. Now I remember you did some related
contributions but 1) that were in userfaultfd05.c (different file), 2) while
this info is in patch on ML [1] instead of it 1840ee23d1 ("userfaultfd05:
require CONFIG_HAVE_ARCH_USERFAULTFD_WP") was merged which does not have this
info.
Having written a reason for things being done differently helps to keep things
not being accidentally removed (or realize it's no longer needed and can be
removed). It's enough to have the info in git log (not everything has to be
documented as a comment in the code). Having it in elsewhere (PR description,
different patch) usually means the info is lost. Also finding the relevant
discussion is why I put Link: tag with URL to patch in lore (yes, I trust lore
archive more than our mailing list archive).
Not everything needs to be in form of a comment in the code, but it's
helps to find the reason if it's at least in git log.
> As RHEL 9 is based on an older kernel(5.14) but includes this
> backport, changing this to .min_kver = "6.1" will cause the
> test to be incorrectly skipped (TCONF) on RHEL 9 systems.
Thanks for info. Of course it will stay. But it'd be good to comment
"needed for RHEL 9" in the test (unfortunately it's not in the commit message).
> Anyway, back to the topic, what is the point of creating this patch?
> Anything I missed?
Nothing besides trying to fix 6.11 (which was not the case) and trying to
simplify. But whole effort is somehow relevant to general checking test
requirements cleanup (we had a discussion runtime checks vs. kconfig/min_kver
which resulted in Cyril's "lib: tst_kconfig: Add runtime checks" [2]).
Kind regards,
Petr
[1] https://lore.kernel.org/ltp/20260123054056.131992-1-liwang@redhat.com/
[2] https://patchwork.ozlabs.org/project/ltp/patch/20260326144006.3035-1-chrubis@suse.cz/
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [LTP] [PATCH] userfaultfd03.c: Require kernel 6.1
2026-03-27 9:05 ` Petr Vorel
@ 2026-03-27 13:17 ` Cyril Hrubis
2026-03-27 13:19 ` Cyril Hrubis
0 siblings, 1 reply; 11+ messages in thread
From: Cyril Hrubis @ 2026-03-27 13:17 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp
Hi!
> > Anyway, back to the topic, what is the point of creating this patch?
> > Anything I missed?
>
> Nothing besides trying to fix 6.11 (which was not the case) and trying to
> simplify. But whole effort is somehow relevant to general checking test
> requirements cleanup (we had a discussion runtime checks vs. kconfig/min_kver
> which resulted in Cyril's "lib: tst_kconfig: Add runtime checks" [2]).
I guess that the check for all userfaultfd tests should be moved to the
tst_kconfig.c once my patch that adds runtime checks there is in.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [LTP] [PATCH] userfaultfd03.c: Require kernel 6.1
2026-03-27 13:17 ` Cyril Hrubis
@ 2026-03-27 13:19 ` Cyril Hrubis
2026-03-27 15:17 ` Petr Vorel
0 siblings, 1 reply; 11+ messages in thread
From: Cyril Hrubis @ 2026-03-27 13:19 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp
Hi!
> > > Anyway, back to the topic, what is the point of creating this patch?
> > > Anything I missed?
> >
> > Nothing besides trying to fix 6.11 (which was not the case) and trying to
> > simplify. But whole effort is somehow relevant to general checking test
> > requirements cleanup (we had a discussion runtime checks vs. kconfig/min_kver
> > which resulted in Cyril's "lib: tst_kconfig: Add runtime checks" [2]).
>
> I guess that the check for all userfaultfd tests should be moved to the
> tst_kconfig.c once my patch that adds runtime checks there is in.
Or I can send a V3 that adds that check as well.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [LTP] [PATCH] userfaultfd03.c: Require kernel 6.1
2026-03-27 13:19 ` Cyril Hrubis
@ 2026-03-27 15:17 ` Petr Vorel
2026-03-27 16:07 ` Cyril Hrubis
0 siblings, 1 reply; 11+ messages in thread
From: Petr Vorel @ 2026-03-27 15:17 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp
> Hi!
> > > > Anyway, back to the topic, what is the point of creating this patch?
> > > > Anything I missed?
> > > Nothing besides trying to fix 6.11 (which was not the case) and trying to
> > > simplify. But whole effort is somehow relevant to general checking test
> > > requirements cleanup (we had a discussion runtime checks vs. kconfig/min_kver
> > > which resulted in Cyril's "lib: tst_kconfig: Add runtime checks" [2]).
> > I guess that the check for all userfaultfd tests should be moved to the
> > tst_kconfig.c once my patch that adds runtime checks there is in.
> Or I can send a V3 that adds that check as well.
Sure, having /dev/userfaultfd in kconfig check would be a benefit. Thanks!
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [LTP] [PATCH] userfaultfd03.c: Require kernel 6.1
2026-03-27 15:17 ` Petr Vorel
@ 2026-03-27 16:07 ` Cyril Hrubis
2026-03-27 16:44 ` Petr Vorel
0 siblings, 1 reply; 11+ messages in thread
From: Cyril Hrubis @ 2026-03-27 16:07 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp
Hi!
> > > > Nothing besides trying to fix 6.11 (which was not the case) and trying to
> > > > simplify. But whole effort is somehow relevant to general checking test
> > > > requirements cleanup (we had a discussion runtime checks vs. kconfig/min_kver
> > > > which resulted in Cyril's "lib: tst_kconfig: Add runtime checks" [2]).
>
> > > I guess that the check for all userfaultfd tests should be moved to the
> > > tst_kconfig.c once my patch that adds runtime checks there is in.
>
> > Or I can send a V3 that adds that check as well.
>
> Sure, having /dev/userfaultfd in kconfig check would be a benefit. Thanks!
However it looks like we cannot do that, the /dev/userfaultfd was added
into 6.1 while the usefaultfd syscall existed since 4.3. Hence tests
that need /dev/userfaultfd need additional checks.
However it may be a good idea to add .needs_kconfig to all the
userfaultfd tests we have.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [LTP] [PATCH] userfaultfd03.c: Require kernel 6.1
2026-03-27 16:07 ` Cyril Hrubis
@ 2026-03-27 16:44 ` Petr Vorel
2026-03-30 14:58 ` Cyril Hrubis
0 siblings, 1 reply; 11+ messages in thread
From: Petr Vorel @ 2026-03-27 16:44 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp
> Hi!
> > > > > Nothing besides trying to fix 6.11 (which was not the case) and trying to
> > > > > simplify. But whole effort is somehow relevant to general checking test
> > > > > requirements cleanup (we had a discussion runtime checks vs. kconfig/min_kver
> > > > > which resulted in Cyril's "lib: tst_kconfig: Add runtime checks" [2]).
> > > > I guess that the check for all userfaultfd tests should be moved to the
> > > > tst_kconfig.c once my patch that adds runtime checks there is in.
> > > Or I can send a V3 that adds that check as well.
> > Sure, having /dev/userfaultfd in kconfig check would be a benefit. Thanks!
> However it looks like we cannot do that, the /dev/userfaultfd was added
> into 6.1 while the usefaultfd syscall existed since 4.3. Hence tests
> that need /dev/userfaultfd need additional checks.
We require for userfaultfd05.c also CONFIG_HAVE_ARCH_USERFAULTFD_WP=y.
Maybe bound /dev/userfaultfd check to it? OTOH
CONFIG_HAVE_ARCH_USERFAULTFD_WP=y is much older (v5.19-rc1) and original commit
in 6.1 [1] does not refer to it.
Also, general note about .needs_kconfig callbacks: I'm glad you chose TINFO
for "%s=%c present but disabled at runtime" message which is always visible,
because people will not expect runtime checks.
Kind regards,
Petr
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2d5de004e009
> However it may be a good idea to add .needs_kconfig to all the
> userfaultfd tests we have.
+1. 4 of them does not have it.
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [LTP] [PATCH] userfaultfd03.c: Require kernel 6.1
2026-03-27 16:44 ` Petr Vorel
@ 2026-03-30 14:58 ` Cyril Hrubis
2026-03-30 22:53 ` Petr Vorel
0 siblings, 1 reply; 11+ messages in thread
From: Cyril Hrubis @ 2026-03-30 14:58 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp
Hi!
> > > > > > Nothing besides trying to fix 6.11 (which was not the case) and trying to
> > > > > > simplify. But whole effort is somehow relevant to general checking test
> > > > > > requirements cleanup (we had a discussion runtime checks vs. kconfig/min_kver
> > > > > > which resulted in Cyril's "lib: tst_kconfig: Add runtime checks" [2]).
>
> > > > > I guess that the check for all userfaultfd tests should be moved to the
> > > > > tst_kconfig.c once my patch that adds runtime checks there is in.
>
> > > > Or I can send a V3 that adds that check as well.
>
> > > Sure, having /dev/userfaultfd in kconfig check would be a benefit. Thanks!
>
> > However it looks like we cannot do that, the /dev/userfaultfd was added
> > into 6.1 while the usefaultfd syscall existed since 4.3. Hence tests
> > that need /dev/userfaultfd need additional checks.
>
> We require for userfaultfd05.c also CONFIG_HAVE_ARCH_USERFAULTFD_WP=y.
> Maybe bound /dev/userfaultfd check to it? OTOH
> CONFIG_HAVE_ARCH_USERFAULTFD_WP=y is much older (v5.19-rc1) and original commit
> in 6.1 [1] does not refer to it.
Does not work either, the /dev/userfaultfd was added without any changes
in CONFIG. If we wanted this as generic funcitionality we would have to
add .needs_devices field into tst_test structure but as far as I my
grepping shows, usefaultfd is at the moment the only test that depends
on a device that has been added recently so it does not look like
it's worth the trouble.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [LTP] [PATCH] userfaultfd03.c: Require kernel 6.1
2026-03-30 14:58 ` Cyril Hrubis
@ 2026-03-30 22:53 ` Petr Vorel
0 siblings, 0 replies; 11+ messages in thread
From: Petr Vorel @ 2026-03-30 22:53 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp
> Hi!
> > > > > > > Nothing besides trying to fix 6.11 (which was not the case) and trying to
> > > > > > > simplify. But whole effort is somehow relevant to general checking test
> > > > > > > requirements cleanup (we had a discussion runtime checks vs. kconfig/min_kver
> > > > > > > which resulted in Cyril's "lib: tst_kconfig: Add runtime checks" [2]).
> > > > > > I guess that the check for all userfaultfd tests should be moved to the
> > > > > > tst_kconfig.c once my patch that adds runtime checks there is in.
> > > > > Or I can send a V3 that adds that check as well.
> > > > Sure, having /dev/userfaultfd in kconfig check would be a benefit. Thanks!
> > > However it looks like we cannot do that, the /dev/userfaultfd was added
> > > into 6.1 while the usefaultfd syscall existed since 4.3. Hence tests
> > > that need /dev/userfaultfd need additional checks.
> > We require for userfaultfd05.c also CONFIG_HAVE_ARCH_USERFAULTFD_WP=y.
> > Maybe bound /dev/userfaultfd check to it? OTOH
> > CONFIG_HAVE_ARCH_USERFAULTFD_WP=y is much older (v5.19-rc1) and original commit
> > in 6.1 [1] does not refer to it.
> Does not work either, the /dev/userfaultfd was added without any changes
> in CONFIG. If we wanted this as generic funcitionality we would have to
> add .needs_devices field into tst_test structure but as far as I my
> grepping shows, usefaultfd is at the moment the only test that depends
> on a device that has been added recently so it does not look like
> it's worth the trouble.
Agree (not worth of the trouble).
Thanks for checking.
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2026-03-30 22:54 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-26 12:52 [LTP] [PATCH] userfaultfd03.c: Require kernel 6.1 Petr Vorel
2026-03-26 21:35 ` Ricardo Branco
2026-03-27 5:41 ` Li Wang via ltp
2026-03-27 9:05 ` Petr Vorel
2026-03-27 13:17 ` Cyril Hrubis
2026-03-27 13:19 ` Cyril Hrubis
2026-03-27 15:17 ` Petr Vorel
2026-03-27 16:07 ` Cyril Hrubis
2026-03-27 16:44 ` Petr Vorel
2026-03-30 14:58 ` Cyril Hrubis
2026-03-30 22:53 ` Petr Vorel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox