aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Rutland <mark.rutland@arm.com>2017-01-05 10:59:33 +0000
committerMark Rutland <mark.rutland@arm.com>2018-04-26 14:18:58 +0100
commited60963595855e66ffc06a8a543cbb429c7ede03 (patch)
tree1d3d4aec58f52ff6643f254a8b955dbafad62a3c
parentc7904c2dee7af838ec08131ecdfe74d4e43a49f9 (diff)
downloadboot-wrapper-aarch64-ed60963595855e66ffc06a8a543cbb429c7ede03.tar.gz
Enable pointer auth for EL2 and belowHEADmaster
By default, use of pointer authentication functionality (either instructions or access to keys) will trap to EL3. This patch programs SCR_EL3 to enable pointer authentication for lower exception levels. Signed-off-by: Mark Rutland <mark.rutland@arm.com>
-rw-r--r--arch/aarch64/boot.S10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/aarch64/boot.S b/arch/aarch64/boot.S
index f7d795a..74705cd 100644
--- a/arch/aarch64/boot.S
+++ b/arch/aarch64/boot.S
@@ -38,6 +38,16 @@ _start:
1: mov x0, #0x30 // RES1
orr x0, x0, #(1 << 0) // Non-secure EL1
orr x0, x0, #(1 << 8) // HVC enable
+
+ /* Enable pointer authentication if present */
+ mrs x1, id_aa64isar1_el1
+ ldr x2, =(((0xff) << 24) | (0xff << 4))
+ and x1, x1, x2
+ cbz x1, 1f
+
+ orr x0, x0, #(1 << 16) // AP key enable
+ orr x0, x0, #(1 << 17) // AP insn enable
+1:
#ifndef KERNEL_32
orr x0, x0, #(1 << 10) // 64-bit EL2
#endif