From 6a006d71b7c18426f65e284362d6b01b60045cb3 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Mon, 12 Jul 2021 10:58:45 -0700 Subject: [PATCH] kernel: add kconfig to say not all code/data is present at boot With demand paging and pinned sections enabled, it is possible for data to be brought into physical memory as required by current execution context. However, the kernel still assumes that all data pages are present at boot which may not be desirable for certain scenarios. This introduces a new kconfig to specify that those data pages other than the boot and pinned sections are not present, and they would be paged in on demand. Signed-off-by: Daniel Leung --- Kconfig.zephyr | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Kconfig.zephyr b/Kconfig.zephyr index dc5843b74b0..383e91c10ef 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -211,6 +211,19 @@ config LINKER_USE_PINNED_SECTION Requires that pinned sections exist in the architecture, SoC, board or custom linker script. +config LINKER_GENERIC_SECTIONS_PRESENT_AT_BOOT + bool "Generic sections are present at boot" if DEMAND_PAGING && LINKER_USE_PINNED_SECTION + default y + help + When disabled, the linker sections other than the boot and + pinned sections will be marked as not present in the page + tables. This allows kernel to pull in data pages on demand + as required by current execution context when demand paging + is enabled. There is no need to load all code and data into + memory at once. + + If unsure, say Y. + endmenu # "Linker Sections" endmenu