Thread (41 messages) 41 messages, 4 authors, 2026-08-24

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

From: Leonardo Bras <hidden>
Date: 2026-08-20 17:04:27
Also in: kvmarm, linux-arm-kernel, linux-kselftest, lkml

On Wed, Aug 12, 2026 at 08:12:04PM +0100, Mark Brown wrote:
quoted hunk ↗ jump to hunk
+static unsigned long compute_exlock(struct kvm_vcpu *vcpu,
+				    unsigned long mode,
+				    unsigned long target_mode)
+{
[...]
quoted hunk ↗ jump to hunk
+
+	if (gcscr & GCSCR_ELx_EXLOCKEN)
+		return PSR_EXLOCK_BIT;
Nit: here I would do:

	return gcscr & GCSCR_ELx_EXLOCKEN;

So that...
quoted hunk ↗ jump to hunk
+	// PSTATE.EXLOCK is set to 0 upon any exception to a higher
+	// EL, or to GCSCR_ELx.EXLOCKEN for an exception to the same
+	// exception level.  See ARM DDI 0487 R_WTXBY.
+	new |= compute_exlock(vcpu, mode, target_mode);
+
we have here, instead (naming is bad):
	
	if (is_exlock_set(vcpu,...))
		new |= PSR_EXLOCK_BIT;

this way it looks more like above sets, such as this one a few lines 
earlier:

	if (kvm_has_mte(kern_hyp_va(vcpu->kvm)))
		new |= PSR_TCO_BIT;

How does that sound?

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