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.