linux/tools
Lorenzo Stoakes (Oracle) 62c65fd740 mm: add mmap_action_map_kernel_pages[_full]()
A user can invoke mmap_action_map_kernel_pages() to specify that the
mapping should map kernel pages starting from desc->start of a specified
number of pages specified in an array.

In order to implement this, adjust mmap_action_prepare() to be able to
return an error code, as it makes sense to assert that the specified
parameters are valid as quickly as possible as well as updating the VMA
flags to include VMA_MIXEDMAP_BIT as necessary.

This provides an mmap_prepare equivalent of vm_insert_pages().  We
additionally update the existing vm_insert_pages() code to use
range_in_vma() and add a new range_in_vma_desc() helper function for the
mmap_prepare case, sharing the code between the two in range_is_subset().

We add both mmap_action_map_kernel_pages() and
mmap_action_map_kernel_pages_full() to allow for both partial and full VMA
mappings.

We update the documentation to reflect the new features.

Finally, we update the VMA tests accordingly to reflect the changes.

Link: https://lkml.kernel.org/r/926ac961690d856e67ec847bee2370ab3c6b9046.1774045440.git.ljs@kernel.org
Signed-off-by: Lorenzo Stoakes (Oracle) <ljs@kernel.org>
Reviewed-by: Suren Baghdasaryan <surenb@google.com>
Acked-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Bodo Stroesser <bostroesser@gmail.com>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Clemens Ladisch <clemens@ladisch.de>
Cc: David Hildenbrand <david@kernel.org>
Cc: David Howells <dhowells@redhat.com>
Cc: Dexuan Cui <decui@microsoft.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Jann Horn <jannh@google.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: K. Y. Srinivasan <kys@microsoft.com>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Long Li <longli@microsoft.com>
Cc: Marc Dionne <marc.dionne@auristor.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Pedro Falcato <pfalcato@suse.de>
Cc: Richard Weinberger <richard@nod.at>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Vignesh Raghavendra <vigneshr@ti.com>
Cc: Wei Liu <wei.liu@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2026-04-05 13:53:45 -07:00
..
accounting delayacct: fix build regression on accounting tool 2026-02-12 15:45:56 -08:00
arch tools headers UAPI: Sync x86's asm/kvm.h with the kernel sources 2026-03-22 18:31:54 -03:00
bootconfig tools/bootconfig: fix fd leak in load_xbc_file() on fstat failure 2026-03-19 08:43:06 +09:00
bpf resolve_btfids: Fix linker flags detection 2026-03-07 08:51:51 -08:00
build tools build: Fix rust cross compilation 2026-03-04 11:37:30 -03:00
certs
cgroup
counter
crypto
debugging kernel-chktaint: add reporting for tainted modules 2026-01-26 19:07:15 -08:00
dma
docs tools: sphinx-build-wrapper: improve its help message 2026-02-02 09:57:46 -07:00
firewire
firmware
gpio
hv
iio
include tools: bitmap: add missing bitmap_copy() implementation 2026-04-05 13:53:41 -07:00
kvm/kvm_stat
laptop
leds
lib mm/vma: add vma_flags_empty(), vma_flags_and(), vma_flags_diff_pair() 2026-04-05 13:53:38 -07:00
memory-model
mm
net NFSD 7.0 Release Notes 2026-02-12 08:23:53 -08:00
objtool objtool: Fix Clang jump table detection 2026-03-16 15:31:25 -07:00
pcmcia
perf perf kvm stat: Fix relative paths for including headers 2026-03-17 17:16:45 -03:00
power cpupower: Add intel_pstate turbo boost support for Intel platforms 2026-03-03 11:18:53 -07:00
rcu
sched
sched_ext tools/sched_ext: Add -fms-extensions to bpf build flags 2026-03-02 22:00:23 -10:00
scripts tools headers: Update the syscall tables and unistd.h, to support the new 'rseq_slice_yield' syscall 2026-03-05 17:20:23 -03:00
sound
spi spi: tools: Add include folder to .gitignore 2026-02-09 12:27:31 +00:00
testing mm: add mmap_action_map_kernel_pages[_full]() 2026-04-05 13:53:45 -07:00
thermal
time
tracing
usb
verification
virtio
wmi
workqueue
writeback
Makefile