diff options
author | Daniel Boulby <daniel.boulby@arm.com> | 2018-09-18 11:45:51 +0100 |
---|---|---|
committer | Antonio Nino Diaz <antonio.ninodiaz@arm.com> | 2018-10-03 11:47:30 +0100 |
commit | 1dcc28cfbac5dae3992ad9581f9ea68f6cb339c1 (patch) | |
tree | 91ba202cfe45aad728e50842fd248238fdd72ec5 /docs/firmware-design.rst | |
parent | 1a4b46d5836d766ba6092206119be030f54462dd (diff) | |
download | trusted-firmware-a-1dcc28cfbac5dae3992ad9581f9ea68f6cb339c1.tar.gz |
Introduce RECLAIM_INIT_CODE build flag
This patch introduces a build flag "RECLAIM_INIT_CODE" to mark boot time
code which allows platforms to place this memory in an appropriate
section to be reclaimed later. This features is primarily targeted for
BL31. Appropriate documentation updates are also done.
Change-Id: If0ca062851614805d769c332c771083d46599194
Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>
Diffstat (limited to 'docs/firmware-design.rst')
-rw-r--r-- | docs/firmware-design.rst | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/docs/firmware-design.rst b/docs/firmware-design.rst index 79bdec98f9..7cc74855de 100644 --- a/docs/firmware-design.rst +++ b/docs/firmware-design.rst @@ -2336,6 +2336,29 @@ implement: SUBSCRIBE_TO_EVENT(foo, foo_handler); + +Reclaiming the BL31 initialization code +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +A significant amount of the code used for the initialization of BL31 is never +needed again after boot time. In order to reduce the runtime memory +footprint, the memory used for this code can be reclaimed after initialization +has finished and be used for runtime data. + +The build option ``RECLAIM_INIT_CODE`` can be set to mark this boot time code +with a ``.text.init.*`` attribute which can be filtered and placed suitably +within the BL image for later reclaimation by the platform. The platform can +specify the fiter and the memory region for this init section in BL31 via the +plat.ld.S linker script. For example, on the FVP, this section is placed +overlapping the secondary CPU stacks so that after the cold boot is done, this +memory can be reclaimed for the stacks. The init memory section is initially +mapped with ``RO``, ``EXECUTE`` attributes. After BL31 initilization has +completed, the FVP changes the attributes of this section to ``RW``, +``EXECUTE_NEVER`` allowing it to be used for runtime data. The memory attributes +are changed within the ``bl31_plat_runtime_setup`` platform hook. The init +section section can be reclaimed for any data which is accessed after cold +boot initialization and it is upto the platform to make the decision. + Performance Measurement Framework --------------------------------- |