Skip to contentSkip to conversation

aarch64: Enable access to allocation tags if MTE is present

PATCH In review Catalin Marinas 2 participants 2 messages May 5, 2021 – May 6, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 aarch64: Enable access to allocation tags if MTE is present

SCR_EL3.ATA must be set so that software can access the allocation (in-memory) MTE tags.

---
 arch/aarch64/boot.S | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/aarch64/boot.S +8 -0
index fd7133d1725c..a9264de937be 100644
@@ -61,6 +61,14 @@ _start:
 	cbz	x1, 1f
 
 	orr	x0, x0, #(1 << 27)		// FGT enable
+1:
+	/* Enable MTE if present */
+	mrs	x10, id_aa64pfr1_el1
+	ubfx	x10, x10, #8, #4
+	cmp	x10, #2
+	b.lt	1f
+
+	orr	x0, x0, #(1 << 26)		// ATA enable
 1:
 #ifndef KERNEL_32
 	orr	x0, x0, #(1 << 10)		// 64-bit EL2

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

#1 lore raw
Quoted 4 lines · Catalin Marinas

SCR_EL3.ATA must be set so that software can access the allocation (in-memory) MTE tags.

Thanks; applied.

Mark.

Quoted 13 lines
---
 arch/aarch64/boot.S | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/aarch64/boot.S +1 -0
index fd7133d1725c..a9264de937be 100644
@@ -61,6 +61,14 @@ _start:
 	cbz	x1, 1f
 
 	orr	x0, x0, #(1 << 27)		// FGT enable
+1:

arch/aarch64/boot.S _start: · line 74

Quoted 10 lines
arch/aarch64/boot.S +7 -0
+	/* Enable MTE if present */
+	mrs	x10, id_aa64pfr1_el1
+	ubfx	x10, x10, #8, #4
+	cmp	x10, #2
+	b.lt	1f
+
+	orr	x0, x0, #(1 << 26)		// ATA enable
 1:
 #ifndef KERNEL_32
 	orr	x0, x0, #(1 << 10)		// 64-bit EL2

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