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

Marc Zyngier maz at kernel.org
Fri Sep 4 06:13:10 PDT 2026


On Fri, 04 Sep 2026 12:35:22 +0100,
Mark Brown <broonie at kernel.org> wrote:
> 
> 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.

I certainly do not care. If you kexec an ancient kernel on new HW and
can't correctly initialise it, you lose. Don't do that.

	M.

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



More information about the linux-arm-kernel mailing list