]> git.ipfire.org Git - thirdparty/linux.git/commit
vdso/datastore: Allocate data pages dynamically
authorThomas Weißschuh <thomas.weissschuh@linutronix.de>
Wed, 4 Mar 2026 07:49:00 +0000 (08:49 +0100)
committerThomas Gleixner <tglx@kernel.org>
Wed, 11 Mar 2026 09:18:30 +0000 (10:18 +0100)
commit05988dba11791ccbb458254484826b32f17f4ad2
tree0f7d36c924f7dfb70133d3fe3e0320f6303b7a15
parentc0c9439ba30738104cdf1a50f82c7c189729f3a6
vdso/datastore: Allocate data pages dynamically

Allocating the data pages as part of the kernel image does not work on
SPARC. The MMU will raise a fault when userspace tries to access them.

Allocate the data pages through the page allocator instead.

Unused pages in the vDSO VMA are still allocated to keep the virtual
addresses aligned. Switch the mapping from PFNs to 'struct page' as that is
required for dynamically allocated pages.  This also aligns the allocation
of the datapages with the code pages and is a prerequisite for mlockall()
support.

VM_MIXEDMAP is necessary for the call to vmf_insert_page() in the timens
prefault path to work.

The data pages need to be order-0, non-compound pages so that the mapping
to userspace and the different orderings work.

These pages are also used by the timekeeping, random pool and architecture
initialization code. Some of these are running before the page allocator is
available. To keep these subsytems working without changes, introduce
early, statically data storage which will then replaced by the real one as
soon as that is available.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
Link: https://patch.msgid.link/20260304-vdso-sparc64-generic-2-v6-3-d8eb3b0e1410@linutronix.de
include/linux/vdso_datastore.h
init/main.c
lib/vdso/datastore.c