[PATCH v15 4/6] KVM: arm64: Set PSTATE.EXLOCK when entering an exception

Mark Brown broonie at kernel.org
Thu Aug 21 13:44:21 PDT 2025


On Wed, Aug 20, 2025 at 11:02:11PM +0100, Marc Zyngier wrote:
> Mark Brown <broonie at kernel.org> wrote:

> > As per DDI 0487 RWTXBY we need to manage PSTATE.EXLOCK when entering an

> Nit: please use an underscore between the type of a statement and its
> "name", as it makes it a bit more readable (R_WTXBY).

Updated as you request.  I have seen both usages - the non _ version
plays nicer with searching the PDF to find the rules since you can just
copy it directly into a PDF viewer.

> > +	// EL, or to GCSCR_ELx.EXLOCKEN for an exception to the same
> > +	// exception level.  See ARM DDI 0487 RWTXBY, D.1.3.2 in K.a.
> > +	new |= enter_exception64_gcs(vcpu, mode, target_mode);
> > +
> >  	new |= PSR_D_BIT;
> >  	new |= PSR_A_BIT;
> >  	new |= PSR_I_BIT;

> But that's not the only case where we have to deal with EXLOCK, is it?
> What of ERET and its PAuth variants? R_TYTWB says:

> <quote>
> If in AArch64 state, any of the following situations can cause an
> illegal exception return:
> 
> [...]
> 
> - If the Effective value of GCSCR_ELx.EXLOCKEN is 1 and PSTATE.EXLOCK
>   is 0, the execution of an exception return instruction to return to
>   the current Exception level ELx.
> </quote>

> My reading of the spec is that this needs handling.

Am I right in thinking that this handling is needed for the NV case
only?
-------------- 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/20250821/467683c3/attachment.sig>


More information about the linux-arm-kernel mailing list