Linux Test Project
 help / color / mirror / Atom feed
From: Andrea Cervesato via ltp <ltp@lists.linux.it>
To: "Wake Liu via ltp" <ltp@lists.linux.it>
Cc: camann@suse.com, Wake Liu <wakel@google.com>,
	rbranco@suse.com, ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] lapi/userfaultfd: Handle ENOSYS in SAFE_USERFAULTFD
Date: Wed, 29 Apr 2026 06:52:34 +0000	[thread overview]
Message-ID: <69f1aab3.5d0a0220.2e761c.6b1c@mx.google.com> (raw)
In-Reply-To: <20260429064011.3200745-1-wakel@google.com>

Hi Wake,

> When CONFIG_USERFAULTFD is not enabled in the kernel, the userfaultfd
> syscall returns ENOSYS. Currently, SAFE_USERFAULTFD calls tst_brk(TBROK)
> for any error other than EPERM, causing tests to fail when they should
> be skipped.
> 
> Add a check for ENOSYS to return TCONF, so that tests using
> SAFE_USERFAULTFD are skipped appropriately on kernels without
> userfaultfd support.
> 
> Signed-off-by: Wake Liu <wakel@google.com>
> ---
>  include/lapi/userfaultfd.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/include/lapi/userfaultfd.h b/include/lapi/userfaultfd.h
> index 0c9e34c84..09126d856 100644
> --- a/include/lapi/userfaultfd.h
> +++ b/include/lapi/userfaultfd.h
> @@ -244,6 +244,10 @@ static inline int safe_userfaultfd(const char *file, const int lineno, int
>  retry:
>  	ret = tst_syscall(__NR_userfaultfd, flags);
>  	if (ret == -1) {
> +		if (errno == ENOSYS) {

This is already handled in the tst_syscall() implementation.
The solution would be to use:

static struct tst_test test = {
  ..
	.needs_kconfigs = (const char *[]) {
		"CONFIG_USERFAULTFD=y",
		NULL
	}
};

for all the tests which need this configuration.

Where did you see this issue? Do you have a use case scenario where
this happened?

Kind regards,
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2026-04-29  6:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-29  6:40 [LTP] [PATCH] lapi/userfaultfd: Handle ENOSYS in SAFE_USERFAULTFD Wake Liu via ltp
2026-04-29  6:52 ` Andrea Cervesato via ltp [this message]
2026-04-29  8:51   ` Wake Liu via ltp
2026-04-29  9:22     ` Andrea Cervesato via ltp
2026-04-29  9:48       ` Wake Liu via ltp
2026-04-29 10:02         ` Andrea Cervesato via ltp
2026-04-29 10:12           ` [LTP] [PATCH] syscalls/userfaultfd04: Require CONFIG_USERFAULTFD=y Wake Liu via ltp
2026-04-29 12:22             ` [LTP] " linuxtestproject.agent
2026-05-06 15:52             ` [LTP] [PATCH] " Andrea Cervesato via ltp
2026-05-06 15:57             ` Andrea Cervesato via ltp
2026-04-29  7:31 ` [LTP] lapi/userfaultfd: Handle ENOSYS in SAFE_USERFAULTFD linuxtestproject.agent
2026-04-29  7:36   ` Andrea Cervesato via ltp
2026-04-29 11:07 ` [LTP] [PATCH] " Cyril Hrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=69f1aab3.5d0a0220.2e761c.6b1c@mx.google.com \
    --to=ltp@lists.linux.it \
    --cc=andrea.cervesato@suse.com \
    --cc=camann@suse.com \
    --cc=rbranco@suse.com \
    --cc=wakel@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox