aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSoby Mathew <soby.mathew@arm.com>2019-12-12 14:25:47 +0000
committerTrustedFirmware Code Review <review@review.trustedfirmware.org>2019-12-12 14:25:47 +0000
commit7999904074b6c08fb3a4f7122470b9a1e739f1fc (patch)
tree1fdbb8c4a4d156d0d8941f921a4f66f95291324f /include
parentfcccd358e4cd6199c797ad127c77c47ec1ad5983 (diff)
parentda90359b7852e13dc21f54f4d42df6d4790fe0cd (diff)
downloadplatform_external_arm-trusted-firmware-7999904074b6c08fb3a4f7122470b9a1e739f1fc.tar.gz
platform_external_arm-trusted-firmware-7999904074b6c08fb3a4f7122470b9a1e739f1fc.tar.bz2
platform_external_arm-trusted-firmware-7999904074b6c08fb3a4f7122470b9a1e739f1fc.zip
Merge "PIE: make call to GDT relocation fixup generalized" into integration
Diffstat (limited to 'include')
-rw-r--r--include/arch/aarch64/el3_common_macros.S29
1 files changed, 28 insertions, 1 deletions
diff --git a/include/arch/aarch64/el3_common_macros.S b/include/arch/aarch64/el3_common_macros.S
index 378e827ce..b14b7b66e 100644
--- a/include/arch/aarch64/el3_common_macros.S
+++ b/include/arch/aarch64/el3_common_macros.S
@@ -232,11 +232,18 @@
*
* _exception_vectors:
* Address of the exception vectors to program in the VBAR_EL3 register.
+ *
+ * _pie_fixup_size:
+ * Size of memory region to fixup Global Descriptor Table (GDT).
+ *
+ * A non-zero value is expected when firmware needs GDT to be fixed-up.
+ *
* -----------------------------------------------------------------------------
*/
.macro el3_entrypoint_common \
_init_sctlr, _warm_boot_mailbox, _secondary_cold_boot, \
- _init_memory, _init_c_runtime, _exception_vectors
+ _init_memory, _init_c_runtime, _exception_vectors, \
+ _pie_fixup_size
.if \_init_sctlr
/* -------------------------------------------------------------
@@ -283,6 +290,26 @@
do_cold_boot:
.endif /* _warm_boot_mailbox */
+ .if \_pie_fixup_size
+#if ENABLE_PIE
+ /*
+ * ------------------------------------------------------------
+ * If PIE is enabled fixup the Global descriptor Table only
+ * once during primary core cold boot path.
+ *
+ * Compile time base address, required for fixup, is calculated
+ * using "pie_fixup" label present within first page.
+ * ------------------------------------------------------------
+ */
+ pie_fixup:
+ ldr x0, =pie_fixup
+ and x0, x0, #~(PAGE_SIZE - 1)
+ mov_imm x1, \_pie_fixup_size
+ add x1, x1, x0
+ bl fixup_gdt_reloc
+#endif /* ENABLE_PIE */
+ .endif /* _pie_fixup_size */
+
/* ---------------------------------------------------------------------
* Set the exception vectors.
* ---------------------------------------------------------------------