Linux Test Project
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Wake Liu <wakel@google.com>
Cc: camann@suse.com, rbranco@suse.com, ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] lapi/userfaultfd: Handle ENOSYS in SAFE_USERFAULTFD
Date: Wed, 29 Apr 2026 13:07:50 +0200	[thread overview]
Message-ID: <afHkQ3kFW1PBSHU0@yuki.lan> (raw)
In-Reply-To: <20260429064011.3200745-1-wakel@google.com>

Hi!
>  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) {
> +			tst_brk_(file, lineno, TCONF | TERRNO,
> +				"userfaultfd() is not supported by this kernel");
> +		}

The tst_syscall() code has already branch that checks for ENOSYS and
calls tst_brk(TCONF, ...) which looks like:

#define TST_SYSCALL_BRK__(NR, SNR) ({ \
tst_brk(TCONF, \
        "syscall(%d) " SNR " not supported on your arch", NR); \
})

#define tst_syscall(NR, ...) ({ \
intptr_t tst_ret; \
if (NR == __LTP__NR_INVALID_SYSCALL) { \
        errno = ENOSYS; \
        tst_ret = -1; \
} else { \
        tst_ret = syscall(NR, ##__VA_ARGS__); \
} \
if (tst_ret == -1 && errno == ENOSYS) { \
        TST_SYSCALL_BRK__(NR, #NR); \
} \
tst_ret; \
})

-- 
Cyril Hrubis
chrubis@suse.cz

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

      parent reply	other threads:[~2026-04-29 11:08 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
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 ` Cyril Hrubis [this message]

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=afHkQ3kFW1PBSHU0@yuki.lan \
    --to=chrubis@suse.cz \
    --cc=camann@suse.com \
    --cc=ltp@lists.linux.it \
    --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