]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
KVM: arm64: nv: Restart stage-1 walk if stage-2 desc update fails
authorOliver Upton <oupton@kernel.org>
Tue, 2 Jun 2026 23:54:50 +0000 (16:54 -0700)
committerMarc Zyngier <maz@kernel.org>
Wed, 3 Jun 2026 20:06:43 +0000 (21:06 +0100)
kvm_walk_nested_s2() returns -EAGAIN as an indication that an underlying
descriptor update fails due to a race. The expectation is that the
caller restart translation, yet walk_s1() actually synthesizes an abort.

Propagate the -EAGAIN return out of walk_s1(), relying on callers to
restart the translation fetch.

Fixes: e4c7dfac2f1a ("KVM: arm64: nv: Implement HW access flag management in stage-2 SW PTW")
Signed-off-by: Oliver Upton <oupton@kernel.org>
Link: https://patch.msgid.link/20260602235450.103057-6-oupton@kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/at.c

index 6cc5892023dd9e6b68c67453d6f0b73bc3ebbbe7..4d4285e60fce5636739d16afcb9b39f52c9f2edb 100644 (file)
@@ -423,6 +423,9 @@ static int walk_s1(struct kvm_vcpu *vcpu, struct s1_walk_info *wi,
 
                if (wi->s2) {
                        ret = kvm_walk_nested_s2(vcpu, ipa, &s2_trans);
+                       if (ret == -EAGAIN)
+                               return ret;
+
                        if (ret) {
                                fail_s1_walk(wr,
                                             (s2_trans.esr & ~ESR_ELx_FSC_LEVEL) | level,