From nobody Tue Apr 26 16:37:21 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 0E414199B5BA; Tue, 26 Apr 2022 16:37:22 +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 4Knnbj4mQXz4hm6; Tue, 26 Apr 2022 16:37:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650991041; 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=NDeZ8/6u6SVjkWIRC3Y2ix+HRlJrlveYMiHbxLs63+k=; b=r9Jf6UlhFm4gJZEX2SQGb/y7ChJmP6SY9eXzEv0Jzrb3OhNSRWKy5KeXloJyC8XygW3kyL jmyFrcMEAYNZEGdK+zo/tcXYv/SppMG76RGo1aBdCr6c0EuLVfl4EtUBEbgkF8hC6/Nyet qy3T5qIw/mPSqWgcvR40oRVG2hVaLb0s/JU2RgSLi72In+gA5jRQ/yu8y9QGfz42C7YqiT HaFz4RXKLAytTRemWDNy6Wxd41AyfhbDqvk60jMkPf7rramk0lqqzZE+I1dibhYS0vyazi kfQefT4EHanHxHAcjLxHmV1+QDsWn6G1PLafwZW/AKoCwasWVySsmUB3wrZz+w== 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 3265712CDB; Tue, 26 Apr 2022 16:37:21 +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 23QGbLhg065562; Tue, 26 Apr 2022 16:37:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23QGbLCP065561; Tue, 26 Apr 2022 16:37:21 GMT (envelope-from git) Date: Tue, 26 Apr 2022 16:37:21 GMT Message-Id: <202204261637.23QGbLCP065561@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: e00aad1042e7 - main - 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/main X-Git-Reftype: branch X-Git-Commit: e00aad1042e7163865763b42d8d72137eeb9df63 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650991041; 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=NDeZ8/6u6SVjkWIRC3Y2ix+HRlJrlveYMiHbxLs63+k=; b=QixwREDszjyxBi4YzfzD2b7Sgx9TEoUgjX3ZrEKTWoMG8StmFArlXUE+kChG/mfJaYUwqu No1WeBaEoogNKg41ATobYMh/7vEa4zuH+svNpfmiYgmSP+jEuyKbWqzaPUdIpw3cq0+feP d/nL8bMY08kBgyb7qjxZR906vG7CvafQ1E8CaPk30uIyJnUzlxoGPNVxWOFwLdvLxGJ3+C 8rYSQt+D4heGfkCOIpCiNFEIA38qMMG6up/Erhquuu6DiBChHjbkChwr9NxUj/z58HHUvL M8/rYQ4dLj62FsDRXNqhoClEXiEkTC/wJAEdmZN+edgkzsrnFGRdoQZBPYxEow== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1650991041; a=rsa-sha256; cv=none; b=q3bN/UKABt1G0lrx1nrjnXQK5UQr2eu8mL68NLyJsDO/HODbluI+jXa9r6A0canbYa0ufG 6tS3ypAs+cB1W9SUS/WyYd8WETbwbHKn6RzNUPCtXSNeCQCcVDMCDyw+jI1/V1pM6Mu8tm 8RSBTlDT1ZbJWuflBmsPJFmg/QvWjnat3ZAl8vFiBwp53hc6SYBLI53WtWv0FhnsxPfZIa Eo+ijnSxDUHhAMZ1k6scQ8rp4/Wt+hUnZ9r/S4c3GW944Pp6UXf+l+pulGsZAzGMxGsEYC PQAyOYyhxg1TmTDHr2npgXe94mkieLCqpQuSRDKzfAXSPIEKLnJAneAo6LZgVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=e00aad1042e7163865763b42d8d72137eeb9df63 commit e00aad1042e7163865763b42d8d72137eeb9df63 Author: Dmitry Chagin AuthorDate: 2022-04-26 16:35:59 +0000 Commit: Dmitry Chagin CommitDate: 2022-04-26 16:35:59 +0000 linux(4): Add epoll_pwai2 syscall. MFC after: 2 weeks --- 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 52f7c58a4347..08d52cd10fc3 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)