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>
This commit is contained in:
Daniel Leung 2021-07-12 10:58:45 -07:00 committed by Christopher Friedt
parent 7771d27525
commit 6a006d71b7

View file

@ -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