From nobody Fri Jun 17 19:39:29 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6A0A485C266; Fri, 17 Jun 2022 19:39:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LPq9t31qvz3RBG; Fri, 17 Jun 2022 19:39:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ADu+u+TQQc1cib5OaQVyDb+dUnumXDlnGAvRpwVFQuc=; b=Ow3a0lsHbVx12GNH86W8NC2J7ib+sVV5/QvR8bWcCVfeoc9d9KCzSJV9U9meEVWhoCg0Zm kZT9fkWe8wOx+xFRGQyX+YVjUBRSRtFo9Hgwn+tSrPlo1tqORIwxBSVdiksYrdwvEu0hYA 89ps+pllmz3eTwIW+EQ2g9n365Fb3xbux6cFjlSYQgUmYamkEx9i53eCZ03Cp3OaKAgOqM sVJJRoH1w8vvM1NdjhG3ckEVEUfze/NtsAQh7SSMpiM/7FYCsy8fD2zc8xguphvWsxhRGA 2+P2QR7Sb16wnsd4zqIq/JC89PfQf4OP7e/8n72/zeDFFwCkuhalh6gP/2ue/g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EFA8225ADA; Fri, 17 Jun 2022 19:39:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 25HJdTHf016087; Fri, 17 Jun 2022 19:39:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25HJdTgn016086; Fri, 17 Jun 2022 19:39:29 GMT (envelope-from git) Date: Fri, 17 Jun 2022 19:39:29 GMT Message-Id: <202206171939.25HJdTgn016086@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 9d4b1eba0ef4 - stable/13 - linux(4): Add epoll_pwai2 syscall. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9d4b1eba0ef49798b417a56e70e1c1235aaa7cf3 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ADu+u+TQQc1cib5OaQVyDb+dUnumXDlnGAvRpwVFQuc=; b=qc6yMtTOK698CTqBdBHSdY7FQFp83mGiglrUQzBWwSUar4uFKXkHOIDQ9w/uyFoaOQQiWI cDHX10l1i5Pp8PQ60MwXxe4gSZ/WVS7+YjWhOhDHOFnG3A01NJDU7rXmllUwrNfjVZy6NT ZEfICHKDp5erjtySkf0xREWo+kIQzZN4KiuNtzCx99FciiFKFNZHBB9BDYOgt7/ohtV7WI d32hqS9mc8a4wmw/uYTsl7YAUVAPglm4iE7eZ2P+RMX1sQDwiEBR2U6Bo1LeElrVlD2gU/ NEtPwCVeEbu9929K+I/DsfuMfekJT3cG315gfXlj1fkWL7xP/oofKZUiBVZlFw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655494770; a=rsa-sha256; cv=none; b=o4NVU7qUMv9Oo3ZwzAHsOur2TfJON3txpiRIy5Y9UhLSeIFE+jlZw7y+NDqnBEV/yIrrGx B0etluW9nelZFCs1pf2X/2+h9VVPIHuB5hkT8oEeM0aftIbH8RkxGp5LGmuKp8tjyLyvfc rTl7aAL3KodWwW6198d2ctWfZNtW3Xf8XhpGBzZUfLZl0kQ0eMNRN8cAetWcyRKTJdKZiP wW6pthV7N86K3keo1EQr2ZKqdIb2WKiznmRtC/xNJGKGFTW9L+rYbc6/4U9sUYOIQRb+b9 Tl8+XZC3OY54n9chCJAqOyCrIZoC8eebaE9WkdRuQ6kHzVdWzFhNmUGu7rtcVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=9d4b1eba0ef49798b417a56e70e1c1235aaa7cf3 commit 9d4b1eba0ef49798b417a56e70e1c1235aaa7cf3 Author: Dmitry Chagin AuthorDate: 2022-04-26 16:35:59 +0000 Commit: Dmitry Chagin CommitDate: 2022-06-17 19:34:10 +0000 linux(4): Add epoll_pwai2 syscall. MFC after: 2 weeks (cherry picked from commit e00aad1042e7163865763b42d8d72137eeb9df63) --- sys/compat/linux/linux_dummy.c | 1 - sys/compat/linux/linux_event.c | 56 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/sys/compat/linux/linux_dummy.c b/sys/compat/linux/linux_dummy.c index 57360c0d1a00..6bfeeaf5c298 100644 --- a/sys/compat/linux/linux_dummy.c +++ b/sys/compat/linux/linux_dummy.c @@ -140,7 +140,6 @@ DUMMY(close_range); DUMMY(openat2); DUMMY(pidfd_getfd); DUMMY(process_madvise); -DUMMY(epoll_pwait2); DUMMY(mount_setattr); /* Linux 4.18: */ DUMMY(io_pgetevents); diff --git a/sys/compat/linux/linux_event.c b/sys/compat/linux/linux_event.c index c96159dcdfe3..7d4d3d678e26 100644 --- a/sys/compat/linux/linux_event.c +++ b/sys/compat/linux/linux_event.c @@ -535,6 +535,62 @@ linux_epoll_pwait(struct thread *td, struct linux_epoll_pwait_args *args) args->maxevents, args->timeout, pmask)); } +#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) +int +linux_epoll_pwait2_64(struct thread *td, struct linux_epoll_pwait2_64_args *args) +{ + struct timespec ts, *tsa; + struct l_timespec64 lts; + sigset_t mask, *pmask; + int error; + + error = linux_copyin_sigset(args->mask, sizeof(l_sigset_t), + &mask, &pmask); + if (error != 0) + return (error); + + if (args->timeout) { + if ((error = copyin(args->timeout, <s, sizeof(lts)))) + return (error); + error = linux_to_native_timespec64(&ts, <s); + if (error != 0) + return (error); + tsa = &ts; + } else + tsa = NULL; + + return (linux_epoll_wait_ts(td, args->epfd, args->events, + args->maxevents, tsa, pmask)); +} +#else +int +linux_epoll_pwait2(struct thread *td, struct linux_epoll_pwait2_args *args) +{ + struct timespec ts, *tsa; + struct l_timespec lts; + sigset_t mask, *pmask; + int error; + + error = linux_copyin_sigset(args->mask, sizeof(l_sigset_t), + &mask, &pmask); + if (error != 0) + return (error); + + if (args->timeout) { + if ((error = copyin(args->timeout, <s, sizeof(lts)))) + return (error); + error = linux_to_native_timespec(&ts, <s); + if (error != 0) + return (error); + tsa = &ts; + } else + tsa = NULL; + + return (linux_epoll_wait_ts(td, args->epfd, args->events, + args->maxevents, tsa, pmask)); +} +#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ + static int epoll_register_kevent(struct thread *td, struct file *epfp, int fd, int filter, unsigned int flags)