[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <cover.1735819274.git.lorenzo.stoakes@oracle.com>
Date: Thu, 2 Jan 2025 12:10:50 +0000
From: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
To: Andrew Morton <akpm@...ux-foundation.org>,
"Liam R . Howlett" <Liam.Howlett@...cle.com>
Cc: Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
Vlastimil Babka <vbabka@...e.cz>, Jann Horn <jannh@...gle.com>,
linux-mm@...ck.org, linux-kernel@...r.kernel.org,
linux-mips@...r.kernel.org
Subject: [PATCH 0/2] mm: update mips to use do_mmap(), make mmap_region() internal
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
Powered by blists - more mailing lists