From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796468811; b=x90eBcmMqLLvjZXXM56hU5SkmRWFYOg80D/ABCZETzyQ91iK+0pIbrxHWykjeuu6LrnP xqtBCg2aCR4/mWFoxBgOmCVtrdHYWHUtnulMUwFOgl2XHyjgU+HjQTtP4ZWfm6sasexsy WC1HO9J+rgGxLIHproBj2S0KJ0pXvZhaZiCTk+Am2Em4adlkmCVfREEkUgmxXO19Y0+MD qc0K1usfNj/Lc1m6FJJkVT71gzUZG3M7o4shKeyc/20PCeOGmPeVA6tYmlVMJmx7ldgWn Fk/x55RqUKkvop7XYCSNRoadkFrllzHBYAbDFuHGReOClpySICqO7cOrYY3it1ySdmQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796468811; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=Urtxq71qDr5Xj2zPvvflK95nwn/gcm1aoy8iHjwyx5A=; b=hS2PO2kqfLt1yN7ZKFDyySBCR1z7zI+HUvGDcRlbLLiVy7GFEN+LjRRUo8mHc9dQrdrX PfFCVL2YB0kHLWZqQLZ5/QJbUPXuAVfOiOTsFAN4sI23d5Ly3rkytDiA2At+j1V16MPnO ufr3/cQvg3DH2hWPp49kf3jaPNHifVxIhYqeroixouAA6RHemHJOBVXbmmFezp7i87BXC Q+exzuKoZs1tSliQUnNHM1UdKy0kNxvMHJBBhgiaQEk0zEMAoMbRFr0M2GlwmJyILlQ/f 7ZkivZQ3VQh9iPU1EfUjDnG0yHYep62dlXnlw5Uhc1EAa5mAZUQaABaedqpfKrfpf7A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=B2X1acrt; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6F711606A322; Sat, 5 Dec 2026 11:06:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=B2X1acrt Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03CE61F00A07; Sat, 5 Dec 2026 11:06:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796468811; bh=Urtxq71qDr5Xj2zPvvflK95nwn/gcm1aoy8iHjwyx5A=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=B2X1acrtzsPSqIIWYMPD3f/6rYjnkX7WP9J3fwIMh6nkjNLYZAR+JmYVAI1SFdWAi XSchQYaKOTb3Aw76xWapyNPnDRWybdkqls7Xbk2+WL7d5RaZZsbHzZXTxxFRwBtqEk M8RiMYrIsZqGUqTOLRMGVIc6ccj4HmZ+vJNu61htrWhGazNf7LWd/FUR2MzY2IRfom hb3JC21eUT0L3G7LqICKhS5WNqZSjGh+18DlawfeuCj73E/QXYSC15L/xX3m1Ly+Jm medok6ZTb87eQXdazYHLyRkV+o4KK503mYK0O3R8W7y5qM69VwgsH0triWLcEsAZSv 9WS4oeTSra+4g== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 6.12.y 5/5] KVM: arm64: vgic: Linearise AP list pruning process Reply-To: sashiko-reviews@lists.linux.dev To: "Marc Zyngier" , kvmarm@lists.linux.dev, kvm@vger.kernel.org Cc: "Oliver Upton" In-Reply-To: <20261205104132.1432014-6-maz@kernel.org> References: <20261205104132.1432014-1-maz@kernel.org> <20261205104132.1432014-6-maz@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sat, 05 Dec 2026 11:06:50 +0000 X-Mailing-List: kvm@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] KVM: arm64: vgic: stale comments and dead IS_ERR checks in AP list pruning -- commit bd77f930cb999af9dd0a13b7508cf2a102774270 Author: Marc Zyngier KVM: arm64: vgic: Linearise AP list pruning process This commit backports upstream commit 504fa43c028d ("KVM: arm64: vgic: Linearise AP list pruning process") to replace the quadratic AP list pruning loop in vgic_prune_ap_list() with a linear culling-list pass that holds only one vCPU ap_list_lock at a time. > diff --git a/arch/arm64/kvm/vgic/vgic.c b/arch/arm64/kvm/vgic/vgic.c > index 967d8111642cf..16818433dc112 100644 > --- a/arch/arm64/kvm/vgic/vgic.c > +++ b/arch/arm64/kvm/vgic/vgic.c > @@ -608,6 +608,26 @@ int kvm_vgic_set_owner(struct kvm_vcpu *vcpu, unsign= ed int intid, void *owner) > return ret; > } > =20 > +/* > + * This helper checks the target *and* does the laundry, nuking the irq = off > + * the ap_list when necessary, and doing the refcount drop on LPIs. -ENO= ENT > + * is returned when LPI release is warranted. > + */ > +static struct kvm_vcpu *vgic_predict_target(struct kvm *kvm, struct vgic= _irq *irq) > +{ > + struct kvm_vcpu *target; > + > + lockdep_assert_held(&irq->irq_lock); > + > + target =3D vgic_target_oracle(irq); > + if (!target) { > + list_del(&irq->ap_list); > + irq->vcpu =3D NULL; > + } > + > + return target; > +} [ ... ] > + /* > + * We skip the processing of an irq in a few cases: > + * - the irq is on the correct target: nothing to do. > + * - the target is NULL: vgic_predict_target() will have > + * culled the irq from the ap_list. > + * - we get an error back: the LPI has been deleted. > + */ > + irq_target =3D vgic_predict_target(vcpu->kvm, irq); > + if (irq_target =3D=3D vcpu || IS_ERR_OR_NULL(irq_target)) { > + raw_spin_unlock(&irq->irq_lock); > + if (!irq_target) > + vgic_put_irq(vcpu->kvm, irq); > + continue; > + } [ ... ] > + irq_target =3D vgic_predict_target(vcpu->kvm, irq); > + if (IS_ERR_OR_NULL(irq_target)) { > + raw_spin_unlock(&irq->irq_lock); > + vgic_put_irq(vcpu->kvm, irq); > + continue; > + } [Severity: Low] In this backport adaptation, vgic_predict_target() no longer drops LPI refcounts or returns -ENOENT, and its kvm parameter is unused. Because vgic_target_oracle() only returns a struct kvm_vcpu pointer or NULL, the comments about -ENOENT and deleted LPIs are stale. Both IS_ERR_OR_NULL(irq_target) checks in vgic_prune_ap_list() also test an unreachable error-pointer case, and treat it inconsistently by guarding vgic_put_irq() with if (!irq_target) only in the first loop. Should the comments be updated, the unused kvm parameter dropped, and IS_ERR_OR_NULL(irq_target) simplified to !irq_target? --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261205104132.1432= 014-1-maz@kernel.org?part=3D5