Enable pointer auth for EL2 and below

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>
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 @@
 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