From: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
To: Andrew Morton <akpm@linux-foundation.org>,
"Liam R . Howlett" <Liam.Howlett@oracle.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
Vlastimil Babka <vbabka@suse.cz>, Jann Horn <jannh@google.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
linux-mips@vger.kernel.org
Subject: [PATCH 0/2] mm: update mips to use do_mmap(), make mmap_region() internal
Date: Thu, 2 Jan 2025 12:10:50 +0000 [thread overview]
Message-ID: <cover.1735819274.git.lorenzo.stoakes@oracle.com> (raw)
Currently the only user of mmap_region() outside of the memory management
code is the MIPS VDSO implementation.
This uses mmap_region() to map a 'delay slot emulation page' at the top of
the stack which is read-only and executable.
This mapping requires that an already-acquired mmap write lock is utilised
and that uffd and populate logic is ignored. This rules out vm_mmap(),
however do_mmap() fits the bill.
Adapt this code to use do_mmap() and then once done, make mmap_region()
internal and userland testable, and avoid any other uses of mmap_region(),
which is absolutely and strictly an internal mm function which bypasses a
great number of checks and logic.
v1:
* Stripped RFC, as Thomas indicated that the approach seemed correct from MIPS
side.
* Avoided whitespace error as pointed out by Matthew.
* Rebased on tip mm-unstable, as previously a conflict emerged after I submitted
the patch (quite possibly one I caused :P).
RFC:
https://lore.kernel.org/all/cover.1734017293.git.lorenzo.stoakes@oracle.com/
Lorenzo Stoakes (2):
mips: vdso: prefer do_mmap() to mmap_region()
mm: make mmap_region() internal
arch/mips/kernel/vdso.c | 10 +++--
include/linux/mm.h | 3 --
mm/mmap.c | 59 -----------------------------
mm/vma.c | 61 +++++++++++++++++++++++++++++-
mm/vma.h | 2 +-
tools/testing/vma/vma_internal.h | 65 ++++++++++++++++++++++++++++++++
6 files changed, 132 insertions(+), 68 deletions(-)
--
2.47.1
next reply other threads:[~2025-01-02 12:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-02 12:10 Lorenzo Stoakes [this message]
2025-01-02 12:10 ` [PATCH 1/2] mips: vdso: prefer do_mmap() to mmap_region() Lorenzo Stoakes
2025-01-02 17:25 ` Liam R. Howlett
2025-01-02 12:10 ` [PATCH 2/2] mm: make mmap_region() internal Lorenzo Stoakes
2025-01-03 16:22 ` Liam R. Howlett
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1735819274.git.lorenzo.stoakes@oracle.com \
--to=lorenzo.stoakes@oracle.com \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=jannh@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=tsbogend@alpha.franken.de \
--cc=vbabka@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox