From nobody Sun Aug 20 07:37:54 2023 X-Original-To: dev-commits-src-main@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 4RT6sG3fMTz4qs3b; Sun, 20 Aug 2023 07:37:54 +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 4RT6sG1zTFz3Ddn; Sun, 20 Aug 2023 07:37:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692517074; 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=Iq9PWJF0xju9JHej7SIWr72jyK+3fgLM7Arh4ByHAfM=; b=VWIv570wGchkKOLETcP9PZ5+ZZ08JSNCtLHHzPjnAUcGETYno/RSW1RRJqhWhVZXr03fPo HdKQ+MmB8Di38TIHRV/Yjb4iYQmZ3f04+Wm/lbg7eswPsn0XQSFK9V14COIk9qdEiYIVJx v0cf+tZZ/kt9JOo74VVWrol0P+rN7dIRa6c8Miooq8gK71R5GcZbjNdu2oNs/lIlEn4AOz GTueo7Lh8dCB4beZMU4Z9Ok+B2vyY7GP8+2K9IjeO2pLw3uVWq/9az3LPp2gUCYalPN5F8 GlMYJIQ12+Vn+zukHXDtxg37Xu0wi9cMnC37NIc3VzVV8SQSVEA+hxT08LglGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692517074; 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=Iq9PWJF0xju9JHej7SIWr72jyK+3fgLM7Arh4ByHAfM=; b=mpxLmodDe5HZZMT79SnCgy+bptbAsJhqwvHlf5K7TnaWfhb8TB1zB8ijcbq7gpOHpLoYVA LB0UjK+B3L4Pc+dw4gYp5I0P3MKRUOIM+efMb4fGOhuzgc25LcGxZGnqddtDyh2c5ODurA crKomot05J5mPhHNL4fTWlS63bvsqBV5Yyny1vD7y120vJd+ApKbRYIDDaPI3dfNSDqwZg U05exouSGqyOoy6IYKUUWX3SXNEvlK3Ry6MMvNxIvTOZCvjhxD6TbKGjViyHzMj/UB7kvw NsESqgtMfi905N2ENiwqpYNODmzMpeNFdHgvEtfIu/Vwa6oGig6clsqqzipOEw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1692517074; a=rsa-sha256; cv=none; b=tYLdDICuOqU9nU4yy956lynS3MEX4z2xa4Hm9nw+Qt4UkohcCeUCgYdNslACMkLuurT/Ia dx3MrIIm+Ht1PgKg7QfGz37RHJ8FWbqeMEjikA6YE33Fj6ffx2sW5Nc9OMgi3eIA2rKoQ0 b2/0Sj3ywXkuUu9zscDSvah8z6fM4MO+m6i8Ta2JxIEyZxsyujgcLMwnFq5iqRpJyV7WJE P+yyoMcnUZ9eM8eQs0+QXhjUwFStcmmk14rTJ86EMM1Bi4/E/aw9jxQPnHbrBOPM0t+cCZ 6ZA1QJIWL6f8rt36qqa3PoTaAPxSPWHwrgEWfPWuGaDgrv3CYo/y9MD7Jrs5RA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4RT6sG13jNzWhp; Sun, 20 Aug 2023 07:37:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37K7bsZ9049992; Sun, 20 Aug 2023 07:37:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37K7bsZF049989; Sun, 20 Aug 2023 07:37:54 GMT (envelope-from git) Date: Sun, 20 Aug 2023 07:37:54 GMT Message-Id: <202308200737.37K7bsZF049989@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: c987ff4d7bd2 - main - linux(4): Replace linux32_copyinuio by freebsd32_copyinuio List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: c987ff4d7bd25e9186ffca84c7e873fd7382a1c7 Auto-Submitted: auto-generated The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=c987ff4d7bd25e9186ffca84c7e873fd7382a1c7 commit c987ff4d7bd25e9186ffca84c7e873fd7382a1c7 Author: Dmitry Chagin AuthorDate: 2023-08-20 07:36:32 +0000 Commit: Dmitry Chagin CommitDate: 2023-08-20 07:36:32 +0000 linux(4): Replace linux32_copyinuio by freebsd32_copyinuio MFC after: 1 month --- sys/amd64/linux32/linux.h | 2 -- sys/amd64/linux32/linux32_machdep.c | 43 +------------------------------------ sys/compat/linux/linux_file.c | 4 ++-- 3 files changed, 3 insertions(+), 46 deletions(-) diff --git a/sys/amd64/linux32/linux.h b/sys/amd64/linux32/linux.h index 1feac8788292..382d010f9ed8 100644 --- a/sys/amd64/linux32/linux.h +++ b/sys/amd64/linux32/linux.h @@ -398,8 +398,6 @@ struct l_iovec32 { int linux32_copyiniov(struct l_iovec32 *iovp32, l_ulong iovcnt, struct iovec **iovp, int error); -int linux32_copyinuio(struct l_iovec32 *iovp, l_ulong iovcnt, - struct uio **uiop); int linux_copyout_rusage(struct rusage *ru, void *uaddr); #endif /* _KERNEL */ diff --git a/sys/amd64/linux32/linux32_machdep.c b/sys/amd64/linux32/linux32_machdep.c index ac8234503bdd..e0364f1e00d1 100644 --- a/sys/amd64/linux32/linux32_machdep.c +++ b/sys/amd64/linux32/linux32_machdep.c @@ -113,47 +113,6 @@ linux_copyout_rusage(struct rusage *ru, void *uaddr) CTASSERT(sizeof(struct l_iovec32) == 8); -int -linux32_copyinuio(struct l_iovec32 *iovp, l_ulong iovcnt, struct uio **uiop) -{ - struct l_iovec32 iov32; - struct iovec *iov; - struct uio *uio; - uint32_t iovlen; - int error, i; - - *uiop = NULL; - if (iovcnt > UIO_MAXIOV) - return (EINVAL); - iovlen = iovcnt * sizeof(struct iovec); - uio = malloc(iovlen + sizeof(*uio), M_IOV, M_WAITOK); - iov = (struct iovec *)(uio + 1); - for (i = 0; i < iovcnt; i++) { - error = copyin(&iovp[i], &iov32, sizeof(struct l_iovec32)); - if (error) { - free(uio, M_IOV); - return (error); - } - iov[i].iov_base = PTRIN(iov32.iov_base); - iov[i].iov_len = iov32.iov_len; - } - uio->uio_iov = iov; - uio->uio_iovcnt = iovcnt; - uio->uio_segflg = UIO_USERSPACE; - uio->uio_offset = -1; - uio->uio_resid = 0; - for (i = 0; i < iovcnt; i++) { - if (iov->iov_len > INT_MAX - uio->uio_resid) { - free(uio, M_IOV); - return (EINVAL); - } - uio->uio_resid += iov->iov_len; - iov++; - } - *uiop = uio; - return (0); -} - int linux32_copyiniov(struct l_iovec32 *iovp32, l_ulong iovcnt, struct iovec **iovp, int error) @@ -188,7 +147,7 @@ linux_readv(struct thread *td, struct linux_readv_args *uap) struct uio *auio; int error; - error = linux32_copyinuio(uap->iovp, uap->iovcnt, &auio); + error = freebsd32_copyinuio(uap->iovp, uap->iovcnt, &auio); if (error) return (error); error = kern_readv(td, uap->fd, auio); diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index c3b69e54d257..6eab8980a5c5 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -1031,7 +1031,7 @@ linux_preadv(struct thread *td, struct linux_preadv_args *uap) if (offset < 0) return (EINVAL); #ifdef COMPAT_LINUX32 - error = linux32_copyinuio(PTRIN(uap->vec), uap->vlen, &auio); + error = freebsd32_copyinuio(PTRIN(uap->vec), uap->vlen, &auio); #else error = copyinuio(uap->vec, uap->vlen, &auio); #endif @@ -1058,7 +1058,7 @@ linux_pwritev(struct thread *td, struct linux_pwritev_args *uap) if (offset < 0) return (EINVAL); #ifdef COMPAT_LINUX32 - error = linux32_copyinuio(PTRIN(uap->vec), uap->vlen, &auio); + error = freebsd32_copyinuio(PTRIN(uap->vec), uap->vlen, &auio); #else error = copyinuio(uap->vec, uap->vlen, &auio); #endif