[PATCH 1/2] KVM: arm64: Initialise TCR2_EL2 for nVHE mode

Mark Brown broonie at kernel.org
Fri Sep 4 04:35:22 PDT 2026


On Fri, Sep 04, 2026 at 08:32:04AM +0100, Marc Zyngier wrote:
> Mark Brown <broonie at kernel.org> wrote:

> > +alternative_if ARM64_HAS_TCR2
> > +	/*
> > +	 * Disable any features we enabled in case the next user doesn't
> > +	 * have TCR2_EL2 support.
> > +	 */
> > +	msr	REG_TCR2_EL2, xzr
> > +alternative_else_nop_endif

> I don't see the point of this. The MMU is off, and if the next piece
> of SW can't correctly initialise the HW, that's its problem.

So we don't care about reverting back to users who are just plain
unaware of the register?  In practice for Linux that's fairly old
kernels, but people might feel adverturous and try or try some non-Linux
thing.  This stuff is all a bit edge casey with what we support.

> And with this hunk gone, the rest should be moved to the following
> patch.

I can do that, I kept it separate since TCR2_EL2 has some other controls
in it and people might want this independently.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20260904/d5f0b5a3/attachment.sig>


More information about the linux-arm-kernel mailing list