[PATCH] arm64: Clear VTCR_EL2 in __init_el2_stage2()

From: Anshuman Khandual

Date: Fri Mar 13 2026 - 01:39:15 EST


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@xxxxxxx>
Cc: Will Deacon <will@xxxxxxxxxx>
Cc: Marc Zyngier <maz@xxxxxxxxxx>
Cc: Oliver Upton <oupton@xxxxxxxxxx>
Cc: Mark Rutland <mark.rutland@xxxxxxx>
Cc: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
Signed-off-by: Anshuman Khandual <anshuman.khandual@xxxxxxx>
---
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