[PATCH v19 06/14] KVM: arm64: Validate GCS exception lock when emulating ERET

Mark Brown broonie at kernel.org
Mon Aug 24 04:11:57 PDT 2026


On Sun, Aug 23, 2026 at 02:18:15PM +0100, Wei-Lin Chang wrote:
> On Fri, Aug 21, 2026 at 11:19:30PM +0100, Mark Brown wrote:

> > As the comment mentions it's not quite that - ELFromSPSR() in the
> > pseudocode has rather more going on in it that I'd managed to convince
> > myself wasn't relevant in this specific context.  I didn't want to give
> > it a name that would cause someone to think it did the full thing and
> > trip them up using it in a different context where those things do
> > matter.  I do agree that this results in awkward naming.

> Right sorry, I missed the pseudocode part. ELFromSPSR pseudocode is
> doing more than what its name indicates...

> If we want to stick with the pseudocode then what do you think about
> el_from_spsr_nocheck/el_from_spsr_raw?

Yeah, those names could help though given your other comment about this
not looking the same as the code in exception.c I ended up changing it
to this:

        /* Check the EL only, ignore thread mode */
        pstate = vcpu->arch.ctxt.regs.pstate;
        cur_mode = (pstate & PSR_MODE_MASK) | PSR_MODE_THREAD_BIT;
        target_mode = (spsr & PSR_MODE_MASK) | PSR_MODE_THREAD_BIT;

instead.
-------------- 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/20260824/e456ed95/attachment.sig>


More information about the linux-arm-kernel mailing list