arm64/mm: Drop wrong writes into TCR2_EL1
authorAnshuman Khandual <anshuman.khandual@arm.com>
Fri, 4 Jul 2025 06:38:12 +0000 (12:08 +0530)
committerWill Deacon <will@kernel.org>
Fri, 4 Jul 2025 15:46:04 +0000 (16:46 +0100)
Register X0 contains PIE_E1_ASM and should not be written into REG_TCR2_EL1
which could have an adverse impact otherwise. This has remained undetected
till now probably because current value for PIE_E1_ASM (0xcc880e0ac0800000)
clears TCR2_EL1 which again gets set subsequently with 'tcr2' after testing
for FEAT_TCR2.

Drop this unwarranted 'msr' which is a stray change from an earlier commit.
This line got re-introduced when rebasing on top of the commit 926b66e2ebc8
("arm64: setup: name 'tcr2' register").

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Fixes: 7052e808c446 ("arm64/sysreg: Get rid of the TCR2_EL1x SysregFields")
Acked-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
Link: https://lore.kernel.org/r/20250704063812.298914-1-anshuman.khandual@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/mm/proc.S

index 80d470aa469d2a8919f8c0e7b7ce41131081b5b4..54dccfd6aa11381ffea36fb3021e2e3eef505bf6 100644 (file)
@@ -518,7 +518,6 @@ alternative_else_nop_endif
        msr     REG_PIR_EL1, x0
 
        orr     tcr2, tcr2, TCR2_EL1_PIE
-       msr     REG_TCR2_EL1, x0
 
 .Lskip_indirection: