public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel•org>
To: Mark Brown <broonie@kernel•org>
Cc: Oliver Upton <oupton@kernel•org>, Joey Gouly <joey.gouly@arm•com>,
	Steffen Eiden <seiden@linux•ibm.com>,
	Suzuki K Poulose <suzuki.poulose@arm•com>,
	Catalin Marinas <catalin.marinas@arm•com>,
	Will Deacon <will@kernel•org>,
	Mark Rutland <mark.rutland@arm•com>,
	linux-arm-kernel@lists•infradead.org, kvmarm@lists•linux.dev,
	linux-kernel@vger•kernel.org
Subject: Re: [PATCH] KVM: arm64: Preserve all guest ZCR_EL2.LEN values
Date: Sat, 23 May 2026 16:24:52 +0100	[thread overview]
Message-ID: <87fr3i9mij.wl-maz@kernel.org> (raw)
In-Reply-To: <ahG75BY6yvaePj-B@sirena.org.uk>

On Sat, 23 May 2026 15:38:28 +0100,
Mark Brown <broonie@kernel•org> wrote:
> 
> On Sat, May 23, 2026 at 09:47:38AM +0100, Marc Zyngier wrote:
> > Mark Brown <broonie@kernel•org> wrote:
> 
> > > Currently all other bits in ZCR_EL2 are either RES0 or RAZ/WI, values
> > > written are sanitised based on this.
> 
> > Only for the direct writes to ZCR_EL2, as they are trapping. I don't
> > see any sanitisation for writes using the ZCR_EL1 accessor, which is
> > the common case. This needs fixing at the same time.
> 
> OK, I'll convert ZCR_EL2 to a sanitised register.  As I mentioned I was
> a bit confused about why the existing code is the way it is and so
> followed it in only managing the direct writes.  I figured it was
> considered OK to rely on the hardware for the RES0 and WI behaviour for
> untrapped access.

In general, that's OK. But given that you need sanitisation in the
trapping case, it is way better to have a uniform behaviour and keep
sanitisation at the accessor level. It is also more sustainable in the
long run, should ZCR_ELx get new significant bits.

Thanks,

	M.

-- 
Jazz isn't dead. It just smells funny.


  reply	other threads:[~2026-05-23 15:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-22 18:00 [PATCH] KVM: arm64: Preserve all guest ZCR_EL2.LEN values Mark Brown
2026-05-23  8:47 ` Marc Zyngier
2026-05-23 14:38   ` Mark Brown
2026-05-23 15:24     ` Marc Zyngier [this message]
2026-05-25 18:36 ` Mark Rutland
2026-05-26 10:19   ` Mark Brown
2026-05-26 12:03     ` Mark Rutland
2026-05-26 13:03       ` Mark Brown

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=87fr3i9mij.wl-maz@kernel.org \
    --to=maz@kernel$(echo .)org \
    --cc=broonie@kernel$(echo .)org \
    --cc=catalin.marinas@arm$(echo .)com \
    --cc=joey.gouly@arm$(echo .)com \
    --cc=kvmarm@lists$(echo .)linux.dev \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=mark.rutland@arm$(echo .)com \
    --cc=oupton@kernel$(echo .)org \
    --cc=seiden@linux$(echo .)ibm.com \
    --cc=suzuki.poulose@arm$(echo .)com \
    --cc=will@kernel$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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