public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: linux-arm-kernel@lists.infradead.org,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Ryan Roberts <ryan.roberts@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arm64/mm: Drop wrong writes into TCR2_EL1
Date: Thu, 03 Jul 2025 09:44:02 +0100	[thread overview]
Message-ID: <868ql5br59.wl-maz@kernel.org> (raw)
In-Reply-To: <20250703050453.136871-1-anshuman.khandual@arm.com>

On Thu, 03 Jul 2025 06:04:53 +0100,
Anshuman Khandual <anshuman.khandual@arm.com> 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 'tcr' after checking
> for FEAT_TCRX.
> 
> Drop this unwarranted 'msr' which is a stray change from an earlier commit.

Looks like I re-introduced this when rebasing on top of 926b66e2ebc8c
("arm64: setup: name 'tcr2' register"), which did remove this line.
Might be worth capturing in the commit message.

> 
> 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")
> Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
> ---
> This patch applies on v6.16-rc4 and tested with and without FEAT_S1PIE
> enabled.
> 
>  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:
>  

Acked-by: Marc Zyngier <maz@kernel.org>

	M.

-- 
Without deviation from the norm, progress is not possible.


      reply	other threads:[~2025-07-03  8:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-03  5:04 [PATCH] arm64/mm: Drop wrong writes into TCR2_EL1 Anshuman Khandual
2025-07-03  8:44 ` Marc Zyngier [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=868ql5br59.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=anshuman.khandual@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=ryan.roberts@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox