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 <daniel.leung@intel.com>
diff --git a/Kconfig.zephyr b/Kconfig.zephyr
index dc5843b..383e91c 100644
--- a/Kconfig.zephyr
+++ b/Kconfig.zephyr
@@ -211,6 +211,19 @@
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