linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2] arm64/mm: Drop wrong writes into TCR2_EL1
@ 2025-07-04  6:38 Anshuman Khandual
  2025-07-04 17:44 ` Will Deacon
  0 siblings, 1 reply; 2+ messages in thread
From: Anshuman Khandual @ 2025-07-04  6:38 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Anshuman Khandual, Catalin Marinas, Will Deacon, Ryan Roberts,
	Marc Zyngier, Mark Rutland, linux-kernel

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>
---
This patch applies on v6.16-rc4 and tested with and without FEAT_S1PIE
enabled.

Changes in V2:

- Added information about the rebase error in the commit message per Marc
- Updated the commit message a bit

Changes in V1:

https://lore.kernel.org/all/20250703050453.136871-1-anshuman.khandual@arm.com/

 arch/arm64/mm/proc.S | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S
index 80d470aa469d..54dccfd6aa11 100644
--- a/arch/arm64/mm/proc.S
+++ b/arch/arm64/mm/proc.S
@@ -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:
 
-- 
2.25.1



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

* Re: [PATCH V2] arm64/mm: Drop wrong writes into TCR2_EL1
  2025-07-04  6:38 [PATCH V2] arm64/mm: Drop wrong writes into TCR2_EL1 Anshuman Khandual
@ 2025-07-04 17:44 ` Will Deacon
  0 siblings, 0 replies; 2+ messages in thread
From: Will Deacon @ 2025-07-04 17:44 UTC (permalink / raw)
  To: linux-arm-kernel, Anshuman Khandual
  Cc: catalin.marinas, kernel-team, Will Deacon, Ryan Roberts,
	Marc Zyngier, Mark Rutland, linux-kernel

On Fri, 04 Jul 2025 12:08:12 +0530, Anshuman Khandual wrote:
> 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").
> 
> [...]

Applied to arm64 (for-next/fixes), thanks!

[1/1] arm64/mm: Drop wrong writes into TCR2_EL1
      https://git.kernel.org/arm64/c/9dd175749341

Cheers,
-- 
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev


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

end of thread, other threads:[~2025-07-04 17:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-04  6:38 [PATCH V2] arm64/mm: Drop wrong writes into TCR2_EL1 Anshuman Khandual
2025-07-04 17:44 ` Will Deacon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).