Thread (41 messages) flat view 41 messages, 4 authors, 25d ago

Re: [PATCH v19 05/14] KVM: arm64: Set PSTATE.EXLOCK when entering an exception

From: Mark Brown <broonie@kernel.org>
Date: 2026-08-21 23:01:26
Also in: kvmarm, linux-doc, linux-kselftest, lkml

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:
quoted
+static unsigned long compute_exlock(struct kvm_vcpu *vcpu,
+				    unsigned long mode,
+				    unsigned long target_mode)
+{
quoted
+	/* 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.

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help