diff options
author | Mark Rutland <mark.rutland@arm.com> | 2017-01-05 10:59:33 +0000 |
---|---|---|
committer | Mark Rutland <mark.rutland@arm.com> | 2018-04-26 14:18:58 +0100 |
commit | ed60963595855e66ffc06a8a543cbb429c7ede03 (patch) | |
tree | 1d3d4aec58f52ff6643f254a8b955dbafad62a3c | |
parent | c7904c2dee7af838ec08131ecdfe74d4e43a49f9 (diff) | |
download | boot-wrapper-aarch64-ed60963595855e66ffc06a8a543cbb429c7ede03.tar.gz |
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.S | 10 |
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 |