Subject: [BOOTWRAPPER PATCH] Enable TME for lower exception levels

From: Will Deacon <[email-masked]>
Date: Fri, 23 Aug 2019 15:50:15 +0100

By default, TME is not available to exception levels below EL3, so
enable it in SCR_EL3 if we detect that it is implemented.

Signed-off-by: Will Deacon <[email-masked]>
---
 arch/aarch64/boot.S | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/aarch64/boot.S b/arch/aarch64/boot.S
index 74705cded338..c2fe92c90297 100644
--- a/arch/aarch64/boot.S
+++ b/arch/aarch64/boot.S
@@ -48,6 +48,13 @@ _start:
 	orr	x0, x0, #(1 << 16)		// AP key enable
 	orr	x0, x0, #(1 << 17)		// AP insn enable
 1:
+	/* Enable TME if present */
+	mrs	x1, id_aa64isar0_el1
+	ubfx	x1, x1, #24, #4
+	cbz	x1, 1f
+
+	orr	x0, x0, #(1 << 34)		// TME enable
+1:
 #ifndef KERNEL_32
 	orr	x0, x0, #(1 << 10)		// 64-bit EL2
 #endif
-- 
2.11.0

_______________________________________________
linux-arm-kernel mailing list
[email-masked]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel