Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Marc Zyngier" <maz@kernel.org>,
	kvmarm@lists.linux.dev, kvm@vger.kernel.org
Cc: "Oliver Upton" <oupton@kernel.org>
Subject: Re: [PATCH 6.1.y 5/5] KVM: arm64: vgic: Linearise AP list pruning process
Date: Sat, 05 Dec 2026 10:55:48 +0000	[thread overview]
Message-ID: <sashiko-outbox-251427@kernel.org> (raw)
In-Reply-To: <20261205104145.1432112-6-maz@kernel.org>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] KVM: arm64: stale comments and dead ERR_PTR checks in
  vgic_predict_target()
--

commit 1c3fcb3fde3a113a8df4be62afe265b892945484
Author: Marc Zyngier <maz@kernel.org>

KVM: arm64: vgic: Linearise AP list pruning process

This patch replaces the quadratic AP list pruning loop in
vgic_prune_ap_list() with a linear pass that moves migrating IRQs onto a
local list before dispatching them to their target vCPUs.

> diff --git a/arch/arm64/kvm/vgic/vgic.c b/arch/arm64/kvm/vgic/vgic.c
> index 7c49b113b1f60..a5c63b7f59353 100644
> --- a/arch/arm64/kvm/vgic/vgic.c
> +++ b/arch/arm64/kvm/vgic/vgic.c
> @@ -610,6 +610,26 @@ int kvm_vgic_set_owner(struct kvm_vcpu *vcpu, unsigned int intid, void *owner)
>  	return ret;
>  }
>  
> +/*
> + * 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. -ENOENT
> + * 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 = vgic_target_oracle(irq);
> +	if (!target) {
> +		list_del(&irq->ap_list);
> +		irq->vcpu = NULL;
> +	}
> +
> +	return target;
> +}

[Severity: Low]
Can the stale comments, unused parameter, and dead error-pointer checks
around vgic_predict_target() be cleaned up in this backport?

Because vgic_put_irq() was moved out of vgic_predict_target() to its
callers, the comment above vgic_predict_target() no longer matches the
code (it neither drops the LPI refcount nor returns -ENOENT), and the
kvm parameter is unused.

Similarly, the comment and both IS_ERR_OR_NULL(irq_target) checks in
vgic_prune_ap_list() assume vgic_predict_target() can return an error
pointer, leaving dead error-pointer handling (and inconsistent
vgic_put_irq() guards across the two call sites).

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261205104145.1432112-1-maz@kernel.org?part=5

      reply	other threads:[~2026-12-05 10:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-05 10:41 [PATCH 6.1.y 0/5] KVM/arm64 stable fixes Marc Zyngier
2026-12-05 10:41 ` [PATCH 6.1.y 1/5] KVM: arm64: vgic-its: Stop the VM when handling MOVALL Marc Zyngier
2026-12-05 10:41 ` [PATCH 6.1.y 2/5] KVM: arm64: vgic-its: Bound PINTID during ITE table restore Marc Zyngier
2026-12-05 10:41 ` [PATCH 6.1.y 3/5] irqchip/gic-v4: Contain VMAPTI vINTID to the expected boundaries Marc Zyngier
2026-12-05 10:41 ` [PATCH 6.1.y 4/5] KVM: arm64: vgic-its: Add signal checks in scan_its_table() Marc Zyngier
2026-12-05 10:41 ` [PATCH 6.1.y 5/5] KVM: arm64: vgic: Linearise AP list pruning process Marc Zyngier
2026-12-05 10:55   ` sashiko-bot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-251427@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.linux.dev \
    --cc=maz@kernel.org \
    --cc=oupton@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox