From nobody Tue Sep 5 18:19:49 2023 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 4RgDLY5dWSz4skdZ; Tue, 5 Sep 2023 18:19:49 +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 4RgDLY57b1z4BYx; Tue, 5 Sep 2023 18:19:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693937989; 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=kFu48XvBQo+tsZ30m/VoWV69jQy0mAYthsDpIZB8tg0=; b=gMvKGhfPpO3L+kfoGNSYv3nfn5K1X5dz/mn2y8iWyi8BwDQ2bnVdWmrOBVpm781N4dwzcy czpKHNXE5AUoK3B/y6+qMDeBLgXscz3seeWaI/U47K47ryPjMZdkr3yWKN1ipd95uNm9Wa VjAE6lAS4VJsu9dCnVtKydqFHPEJEacv2Zltio33fbauROnltLs1iio5I/PqSb/R7lnZcE jhhVGnqJg9wKuXJXyaBeU6zTnkN4Ne2xB3yPJmv8QdB3QMV8ensB7GhaRM+q/95dWOEVTi 4dsFaw4AJS8K0gntbNdDcKL146f6mu7HS1hkKn+9crHB7jrXjj/vS5FITmDJfQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693937989; a=rsa-sha256; cv=none; b=GPLUESZS6Tw5D1vuSAqFeLDmLKjZ61ceLo+dtjYV1HV8aQPm9XMjc1DaTB6Pwpjlh/4oQe 3e3w74iFi7efnn9zj2YBU1fcXOobTeOBGtRIshKbmcd7cT2QKVR3FO42MWMrkrdY3YFon1 N7KsCNho7CnViLsX9r6k11qibBhMJImmegNEZNAAr6/r+JxOMTIQnXr22h4SINPbaX3LCp AJfyTJ1L6y9JI8C9hK5vT7gv2PhdrL3oN0bqUJY/bQfoukDrMHDsvrPpn6JSdVVLq1G5ws Z7Cz1CQ+Lc0nf1CT8789+Oy1grxWiwZF78HOIDQUvLUo3aa4P/E6TELlwCR5KQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693937989; 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=kFu48XvBQo+tsZ30m/VoWV69jQy0mAYthsDpIZB8tg0=; b=PkPgOxTCmjWy42b1YKbAnmK8nebnMe73u3aubZ+3TxrHPbgaMUEw+xSD5hQGIvETvFQMfu Q6DWF/Xz1fHd39pJy/94FqXoEU/dx8WEWEDjXaXbDhaQP8StoVQiXP/TRRTOeI5dH/szxH 4alc2Jeoy4/KghzJJyg7kRBj+zjgUxbYNnjiIRy31ZLqE1MSQaftuXqRR+o8qHqrfauBNs ZWa0sY6s4B1A5h3BSmlbA3X5eYJP4Mfv9EIBaCbrJMgvhGxuwiF6E6PX5ZF72VG97k0cpb FhzzzMEyWZZE53XKbD/X8BjdDpMVXD7+NN9ZKMD6XyLew3P+i9oAYFY1rLzWPw== 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 4RgDLY4512zjxk; Tue, 5 Sep 2023 18:19:49 +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 385IJnvO058389; Tue, 5 Sep 2023 18:19:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 385IJngI058386; Tue, 5 Sep 2023 18:19:49 GMT (envelope-from git) Date: Tue, 5 Sep 2023 18:19:49 GMT Message-Id: <202309051819.385IJngI058386@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: 553b1a4e4eb4 - main - linux(4): Deduplicate mprotect, madvise 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: 553b1a4e4eb426d2c29a033b284c13bfbab30334 Auto-Submitted: auto-generated The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=553b1a4e4eb426d2c29a033b284c13bfbab30334 commit 553b1a4e4eb426d2c29a033b284c13bfbab30334 Author: Dmitry Chagin AuthorDate: 2023-09-05 18:15:52 +0000 Commit: Dmitry Chagin CommitDate: 2023-09-05 18:15:52 +0000 linux(4): Deduplicate mprotect, madvise MFC after: 1 week --- sys/amd64/linux/linux_machdep.c | 14 -------------- sys/amd64/linux32/linux32_machdep.c | 15 --------------- sys/arm64/linux/linux_machdep.c | 15 --------------- sys/compat/linux/linux_misc.c | 17 +++++++++++++++++ sys/i386/linux/linux_machdep.c | 14 -------------- 5 files changed, 17 insertions(+), 58 deletions(-) diff --git a/sys/amd64/linux/linux_machdep.c b/sys/amd64/linux/linux_machdep.c index 2d2c5bb55ac8..7da1dccd6b45 100644 --- a/sys/amd64/linux/linux_machdep.c +++ b/sys/amd64/linux/linux_machdep.c @@ -97,20 +97,6 @@ linux_mmap2(struct thread *td, struct linux_mmap2_args *args) args->flags, args->fd, args->pgoff)); } -int -linux_mprotect(struct thread *td, struct linux_mprotect_args *uap) -{ - - return (linux_mprotect_common(td, uap->addr, uap->len, uap->prot)); -} - -int -linux_madvise(struct thread *td, struct linux_madvise_args *uap) -{ - - return (linux_madvise_common(td, uap->addr, uap->len, uap->behav)); -} - int linux_iopl(struct thread *td, struct linux_iopl_args *args) { diff --git a/sys/amd64/linux32/linux32_machdep.c b/sys/amd64/linux32/linux32_machdep.c index f6b14d8e4653..fb088ae37b26 100644 --- a/sys/amd64/linux32/linux32_machdep.c +++ b/sys/amd64/linux32/linux32_machdep.c @@ -62,7 +62,6 @@ #include #include #include -#include #include #include #include @@ -345,20 +344,6 @@ linux_mmap(struct thread *td, struct linux_mmap_args *args) (uint32_t)linux_args.pgoff)); } -int -linux_mprotect(struct thread *td, struct linux_mprotect_args *uap) -{ - - return (linux_mprotect_common(td, PTROUT(uap->addr), uap->len, uap->prot)); -} - -int -linux_madvise(struct thread *td, struct linux_madvise_args *uap) -{ - - return (linux_madvise_common(td, PTROUT(uap->addr), uap->len, uap->behav)); -} - int linux_iopl(struct thread *td, struct linux_iopl_args *args) { diff --git a/sys/arm64/linux/linux_machdep.c b/sys/arm64/linux/linux_machdep.c index 9c9d56ca9949..b9548387315b 100644 --- a/sys/arm64/linux/linux_machdep.c +++ b/sys/arm64/linux/linux_machdep.c @@ -77,21 +77,6 @@ linux_mmap2(struct thread *td, struct linux_mmap2_args *uap) uap->flags, uap->fd, uap->pgoff)); } -int -linux_mprotect(struct thread *td, struct linux_mprotect_args *uap) -{ - - return (linux_mprotect_common(td, PTROUT(uap->addr), uap->len, - uap->prot)); -} - -int -linux_madvise(struct thread *td, struct linux_madvise_args *uap) -{ - - return (linux_madvise_common(td, PTROUT(uap->addr), uap->len, uap->behav)); -} - int linux_set_cloned_tls(struct thread *td, void *desc) { diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 5e692fea1ea7..b9c67d513cd3 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -75,6 +75,7 @@ #include #include #include +#include #include #include #include @@ -348,6 +349,22 @@ linux_msync(struct thread *td, struct linux_msync_args *args) args->fl & ~LINUX_MS_SYNC)); } +int +linux_mprotect(struct thread *td, struct linux_mprotect_args *uap) +{ + + return (linux_mprotect_common(td, PTROUT(uap->addr), uap->len, + uap->prot)); +} + +int +linux_madvise(struct thread *td, struct linux_madvise_args *uap) +{ + + return (linux_madvise_common(td, PTROUT(uap->addr), uap->len, + uap->behav)); +} + #ifdef LINUX_LEGACY_SYSCALLS int linux_time(struct thread *td, struct linux_time_args *args) diff --git a/sys/i386/linux/linux_machdep.c b/sys/i386/linux/linux_machdep.c index 8dbcbcd2609e..7f1738cda845 100644 --- a/sys/i386/linux/linux_machdep.c +++ b/sys/i386/linux/linux_machdep.c @@ -332,20 +332,6 @@ linux_mmap(struct thread *td, struct linux_mmap_args *args) (uint32_t)linux_args.pgoff)); } -int -linux_mprotect(struct thread *td, struct linux_mprotect_args *uap) -{ - - return (linux_mprotect_common(td, PTROUT(uap->addr), uap->len, uap->prot)); -} - -int -linux_madvise(struct thread *td, struct linux_madvise_args *uap) -{ - - return (linux_madvise_common(td, PTROUT(uap->addr), uap->len, uap->behav)); -} - int linux_ioperm(struct thread *td, struct linux_ioperm_args *args) {