All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][boot-wrapper] aarch64: Enable ECV to allow access to CNTPOFF_EL2
@ 2021-08-11  9:22 Marc Zyngier
  2021-08-11 13:55 ` Mark Rutland
  0 siblings, 1 reply; 4+ messages in thread
From: Marc Zyngier @ 2021-08-11  9:22 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Mark Rutland, Oliver Upton

If the implemnentation supports ID_AA64MMFR0_EL1.ECV==2,
set SCR_EL3.ECVEn to allow EL2 access to CNTPOFF_EL2.

Signed-off-by: Marc Zyngier <maz@kernel.org>
---
 arch/aarch64/boot.S | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/arch/aarch64/boot.S b/arch/aarch64/boot.S
index 7f208b5..f0aa3cb 100644
--- a/arch/aarch64/boot.S
+++ b/arch/aarch64/boot.S
@@ -54,10 +54,17 @@ ASM_FUNC(_start)
 1:
 	/* Enable FGT if present */
 	mrs	x1, id_aa64mmfr0_el1
-	ubfx	x1, x1, #56, #4
-	cbz	x1, 1f
+	ubfx	x2, x1, #56, #4
+	cbz	x2, 1f
 
 	orr	x0, x0, #(1 << 27)		// FGT enable
+1:
+	/* Enable ECV2 if present (allows CNTPOFF_EL2) */
+	ubfx	x2, x1, #60, #4
+	cmp	x2, #2
+	bne	1f
+
+	orr	x0, x0, #(1 << 28)		// ECV enable
 1:
 	/* Enable MTE if present */
 	mrs	x10, id_aa64pfr1_el1
-- 
2.30.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-08-11 14:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-11  9:22 [PATCH][boot-wrapper] aarch64: Enable ECV to allow access to CNTPOFF_EL2 Marc Zyngier
2021-08-11 13:55 ` Mark Rutland
2021-08-11 14:45   ` Marc Zyngier
2021-08-11 14:49     ` Mark Rutland

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.