feat(runtime): for each CPU only map their own stack respectively
This commit changes the memory mapping of the stack area. Instead of
flat-mapping the whole stack area for each CPU, only map the stack
area for that particular CPU in the High region.
For this to work, the following changes are made:
- move the mapping of the high region out from the realm lib to the
xlat library
- move the build time config option RMM_NUM_PAGES_PER_STACK to the xlat
library.
- add a new mm region to the high VA space for the stack of that CPU.
- reorder segments in the linker script so that `.percpu` segment is
the last. Change flat-mapping configurations so that the `.percpu`
segment is not added.
Change-Id: I997c1b5ff2b972807d75692b5efc9075c5a29a30
Signed-off-by: Mate Toth-Pal <mate.toth-pal@arm.com>
diff --git a/cmake/CommonConfigs.cmake b/cmake/CommonConfigs.cmake
index ee896ac..b8709ac 100644
--- a/cmake/CommonConfigs.cmake
+++ b/cmake/CommonConfigs.cmake
@@ -31,6 +31,13 @@
DEFAULT 0x0)
arm_config_option(
+ NAME RMM_NUM_PAGES_PER_STACK
+ HELP "Number of pages to use per CPU stack"
+ TYPE STRING
+ DEFAULT 5
+ ADVANCED)
+
+arm_config_option(
NAME RMM_DOCS
HELP "RMM Documentation build"
TYPE BOOL
@@ -76,6 +83,9 @@
target_compile_definitions(rmm-common
INTERFACE "RMM_MAX_GRANULES=U(${RMM_MAX_GRANULES})")
+target_compile_definitions(rmm-common
+ INTERFACE "RMM_NUM_PAGES_PER_STACK=UL(${RMM_NUM_PAGES_PER_STACK})")
+
if(RMM_FPU_USE_AT_REL2)
target_compile_definitions(rmm-common
INTERFACE "RMM_FPU_USE_AT_REL2=1")