From nobody Tue Sep 12 07:49:43 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 4RlG2J0Tx7z4tgYX; Tue, 12 Sep 2023 07:49:44 +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 4RlG2H6z2dz3M6K; Tue, 12 Sep 2023 07:49:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694504984; 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=Q8d+35yov/Fg9Yxjvso3ckFVHWQCXXNTGhdzynSFIQw=; b=cCYJs4B8sgp89bD2IbO3dQLEW64OI6zys21kttcFnrsV9LrscTN/tG8AvCVJMMhPmxGsha V0IIPG+P9v2B0yUNnD7GQlnr2Lhg67Uejb+og5W9V/cqdAUS2vkDT3xc93hdsMLYF2T9RS GNfQPuJmKnbfLVhKxATbnO/cydLvP0+6/KKf/kqK3qBgi53b9dzwyoYd/N2m+Lo7c133Oh u2k3pXTb0Xfu600XEbBNk7S8MEsSpNTS6XJMCor3S2V4pBFWkQUdUabs44ccxGziKBRM2c 8Uyv1C5O+K/DrgCJ/CUe7J0E1Q8QAx6Ip+0WDw+GXgALmIZv3SnBqnXopQH/hA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1694504984; a=rsa-sha256; cv=none; b=dYyOJWXbcH8EOfEndVrgFZuVZSf4Gqg9JyGjCUF/GK6JzXkzao6q/GSin0oLnlyHRqI2iq zqM2KvUaN4u4Qhv5oT75m5vV64+Jo0EE4Hb+T5aUnCGfId6zIidKgWZox4f2ldpj+RfODv RzvnO/jpPLviFGk9YXtSau4mqlEXgaEirBGQrmQ8C/EoGxFruSYkqJxBlvW4yDg74Zojpa oUCt4CfLmIJEw8XEbBI5BI5NsC+VZ91nbM0y25pQkrQl4D2bmaWUcDjZP513L53WL5FlNb xvJpOM2r7wdLr/wwMYhlh9IzYgYcuLZHdl4sJmrUf17dBQeKt7PeI1bbvtG5pA== 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=1694504984; 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=Q8d+35yov/Fg9Yxjvso3ckFVHWQCXXNTGhdzynSFIQw=; b=XbnmyqqYpKe4AwjEEEgiM8UAM+kDELGgUTANozGrlzrqxdGgCzTEFU150i+a+8bca8DVUY GuvS4PwvKI21KC/D9rTbvfTlA6RbTgyicPMSgctLxvJO+6mWXp1Teq8KGLYV86iXabgnrB +9nBb1CWlMa4bMC4Px3kHWHjpVNUp0pOpMUJUqrT9mwt9aZv5H7ylEZRtzv2r8PgpuIOAE KKNDs54VaUv8gaaH6octQwYZ0wRi3XXyutLjY+aqA97RRevBQjUdPZbws51PpEMALYvdMl fbhoDzm+DzBWgwkMiGjlwrk0oAo8q3xkOGrMGXMZ6RJyGKXy9gW82qJUXSny9g== 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 4RlG2H604jz871; Tue, 12 Sep 2023 07:49:43 +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 38C7nhTP072243; Tue, 12 Sep 2023 07:49:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38C7nhuG072240; Tue, 12 Sep 2023 07:49:43 GMT (envelope-from git) Date: Tue, 12 Sep 2023 07:49:43 GMT Message-Id: <202309120749.38C7nhuG072240@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: 4d1723961743 - stable/14 - 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 4d17239617439b9a500f4c7a59f5f4d323d252b7 Auto-Submitted: auto-generated The branch stable/14 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=4d17239617439b9a500f4c7a59f5f4d323d252b7 commit 4d17239617439b9a500f4c7a59f5f4d323d252b7 Author: Dmitry Chagin AuthorDate: 2023-09-05 18:15:52 +0000 Commit: Dmitry Chagin CommitDate: 2023-09-12 07:48:39 +0000 linux(4): Deduplicate mprotect, madvise MFC after: 1 week (cherry picked from commit 553b1a4e4eb426d2c29a033b284c13bfbab30334) --- 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) {