public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [bootwrapper PATCH] aarch64: Enable BRBE for the non-secure world
@ 2022-01-13  9:41 Anshuman Khandual
  2022-01-13 10:24 ` Mark Rutland
  0 siblings, 1 reply; 6+ messages in thread
From: Anshuman Khandual @ 2022-01-13  9:41 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: mark.rutland, andre.przywara, robin.murphy, Anshuman Khandual

MDCR_EL3.SBRBE resets to an UNKNOWN value. Configure it to allow the BRBE
buffer usage and direct register access in the non-secure world. But just
before that, check AA64DFR0_EL1.BRBE and make sure BRBE is implemented. We
still continue to reset MDCR_EL3 register to zero with the exception of
MDCR_EL3.NSPB, MDCR_EL3.NSTB and MDCR_EL3.SBRBE.

Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
---
 arch/aarch64/boot.S | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/aarch64/boot.S b/arch/aarch64/boot.S
index bfbb6ec..ca1b292 100644
--- a/arch/aarch64/boot.S
+++ b/arch/aarch64/boot.S
@@ -103,6 +103,14 @@ ASM_FUNC(_start)
 	ldr	x1, =(0x3 << 24)
 	orr	x0, x0, x1
 
+1:	mrs     x1, id_aa64dfr0_el1
+	ubfx    x1, x1, #52, #4
+	cbz     x1, 1f
+
+	// Enable BRBE for the non-secure world.
+	ldr     x1, =(0x3 << 32)
+	orr     x0, x0, x1
+
 1:	msr	mdcr_el3, x0			// Disable traps to EL3
 
 	mrs	x0, id_aa64pfr0_el1
-- 
2.7.4


_______________________________________________
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] 6+ messages in thread

end of thread, other threads:[~2022-01-18 10:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-13  9:41 [bootwrapper PATCH] aarch64: Enable BRBE for the non-secure world Anshuman Khandual
2022-01-13 10:24 ` Mark Rutland
2022-01-17 10:36   ` Anshuman Khandual
2022-01-17 13:25     ` Mark Rutland
2022-01-18  2:42       ` Anshuman Khandual
2022-01-18 10:34         ` Mark Rutland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox