[PATCH] arm64: Clear VTCR_EL2 in __init_el2_stage2()

Anshuman Khandual anshuman.khandual at arm.com
Thu Mar 12 22:38:57 PDT 2026


Clear VTCR_EL2 along with VTTBR_EL2 register in __init_el2_stage2(), which
ensures that MMU stage-2 translation remain disabled. Although clearing out
VTTBR_EL2 probably should have been sufficient but adding VTCR_EL2 improves
overall safety.

Cc: Catalin Marinas <catalin.marinas at arm.com>
Cc: Will Deacon <will at kernel.org>
Cc: Marc Zyngier <maz at kernel.org>
Cc: Oliver Upton <oupton at kernel.org>
Cc: Mark Rutland <mark.rutland at arm.com>
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-kernel at vger.kernel.org
Signed-off-by: Anshuman Khandual <anshuman.khandual at arm.com>
---
 arch/arm64/include/asm/el2_setup.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/include/asm/el2_setup.h b/arch/arm64/include/asm/el2_setup.h
index 85f4c1615472..2c88033591bb 100644
--- a/arch/arm64/include/asm/el2_setup.h
+++ b/arch/arm64/include/asm/el2_setup.h
@@ -189,6 +189,7 @@
 /* Stage-2 translation */
 .macro __init_el2_stage2
 	msr	vttbr_el2, xzr
+	msr	vtcr_el2, xzr
 .endm
 
 /* GICv3 system register access */
-- 
2.30.2




More information about the linux-arm-kernel mailing list