Re: [PATCH v19 05/14] KVM: arm64: Set PSTATE.EXLOCK when entering an exception
Mark Brown <[email protected]>
| Newsgroups | org.kernel.vger.linux-kselftest,dev.linux.lists.kvmarm,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-doc,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
On Fri, Aug 21, 2026 at 03:15:26PM +0100, Wei-Lin Chang wrote:
> On Wed, Aug 12, 2026 at 08:12:04PM +0100, Mark Brown wrote:
> > +static unsigned long compute_exlock(struct kvm_vcpu *vcpu,
> > + unsigned long mode,
> > + unsigned long target_mode)
> > +{
> > + /* When taking an exception to a higher EL EXLOCK is cleared. */
> > + if ((mode | PSR_MODE_THREAD_BIT) != target_mode)
> > + return 0;
> This is essentially doing an EL comparison, which is also done in
> kvm_check_illegal_exlock_return() later. Would it be clearer if we
> follow the EL comparison pattern there? exlock_el_from_spsr() can have
> more use too.
Yeah, I wasn't super happy there - it's partly a question of what's to
hand and already in use in each location. The rest of this code is
using mode. I think given your valid concerns about the naming around
parsing out the EL in kvm_check_illegal_exlock_return() it's easier to
go the other way, make that code look more like this and hence sidestep
the naming issue.
signature.asc
(application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmqI2L8ACgkQJNaLcl1U h9DSmwf/Ti0qrhR56sAQYWMszAac7N7dyJ3/ETOQS6tSsbmRY66niGgwbEcvnlmT iO/PPDo/y69zkAb/VJI+/SwgyfEdUgsZ1EaoiU6svLwuuGCs5EAVZuKgRbJgUy6K f5hqKyIKwydaHgcMm5lyGK830e1Wnd9Fs/huhmqm1L6/0XJzAo4qdXv8rwQRyAD/ fIsWz2zBB2eOw8hrICNHcsj9HUlwGb9GXIHi6OkLZUFvCI3S67LRMJB6RSP04erl jZyM5Hm6qhCQoxlwVQvrrrnv7rrnUdbpsoHHAHymeTBfiRvEs5hPwv/elFOsaFGu qg/SXCg5sZWsIWQtuQ3IO69sfo5bMQ== =6Imv -----END PGP SIGNATURE-----