summaryrefslogtreecommitdiff
path: root/bl1
diff options
context:
space:
mode:
Diffstat (limited to 'bl1')
-rw-r--r--bl1/aarch64/bl1_exceptions.S9
-rw-r--r--bl1/bl1_main.c10
2 files changed, 19 insertions, 0 deletions
diff --git a/bl1/aarch64/bl1_exceptions.S b/bl1/aarch64/bl1_exceptions.S
index 3e72e39f..9bba6eef 100644
--- a/bl1/aarch64/bl1_exceptions.S
+++ b/bl1/aarch64/bl1_exceptions.S
@@ -226,6 +226,15 @@ smc_handler:
*/
bl save_gp_pmcr_pauth_regs
+#if ENABLE_PAUTH
+ /* -----------------------------------------------------
+ * Load and program stored APIAKey firmware key.
+ * Re-enable pointer authentication in EL3, as it was
+ * disabled before jumping to the next boot image.
+ * -----------------------------------------------------
+ */
+ bl pauth_load_bl1_apiakey_enable
+#endif
/* -----------------------------------------------------
* Populate the parameters for the SMC handler. We
* already have x0-x4 in place. x5 will point to a
diff --git a/bl1/bl1_main.c b/bl1/bl1_main.c
index 2bb85114..cd6fe7d5 100644
--- a/bl1/bl1_main.c
+++ b/bl1/bl1_main.c
@@ -31,6 +31,10 @@ DEFINE_SVC_UUID2(bl1_svc_uid,
static void bl1_load_bl2(void);
+#if ENABLE_PAUTH
+uint64_t bl1_apiakey[2];
+#endif
+
/*******************************************************************************
* Helper utility to calculate the BL2 memory layout taking into consideration
* the BL1 RW data assuming that it is at the top of the memory layout.
@@ -131,6 +135,12 @@ void bl1_main(void)
/* Perform platform setup in BL1. */
bl1_platform_setup();
+#if ENABLE_PAUTH
+ /* Store APIAKey_EL1 key */
+ bl1_apiakey[0] = read_apiakeylo_el1();
+ bl1_apiakey[1] = read_apiakeyhi_el1();
+#endif /* ENABLE_PAUTH */
+
/* Get the image id of next image to load and run. */
image_id = bl1_plat_get_next_image_id();