mm/kmm_map: Add support to dynamically map pages into kernel virtual memory

This adds functionality to map pages dynamically into kernel virtual
memory. This allows implementing I/O remap for example, which is a useful
(future) feature.

Now, the first target is to support mapping user pages for the kernel.

Why? There are some userspace structures that might be needed when the
userspace process is not running. Semaphores are one such example. Signals
and the WDT timeout both need access to the user semaphore to work
properly. Even though for this only obtaining the kernel addressable
page pool virtual address is needed, for completeness a procedure is
provided to map several pages.
This commit is contained in:
Ville Juven
2023-04-13 16:25:22 +03:00
committed by Xiang Xiao
parent 223c5a3722
commit 0476e30a6d
9 changed files with 763 additions and 0 deletions
+10
View File
@@ -189,6 +189,16 @@ config MM_SHM
Build in support for the shared memory interfaces shmget(), shmat(),
shmctl(), and shmdt().
config MM_KMAP
bool "Support for dynamic kernel virtual mappings"
default n
depends on MM_PGALLOC && BUILD_KERNEL
select ARCH_VMA_MAPPING
---help---
Build support for dynamically mapping pages from the page pool into
kernel virtual memory. This includes pages that are already mapped
for user.
config MM_HEAP_MEMPOOL_THRESHOLD
int "The size of threshold to avoid using multiple mempool in heap"
default 0