All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oliver Upton <oliver.upton@linux.dev>
To: Marc Zyngier <maz@kernel.org>
Cc: kvmarm@lists.linux.dev, Joey Gouly <joey.gouly@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Zenghui Yu <yuzenghui@huawei.com>,
	Sweet Tea Dorminy <sweettea@google.com>
Subject: Re: [PATCH 3/5] KVM: arm64: Resolve vLPI by host IRQ in vgic_v4_unset_forwarding()
Date: Fri, 23 May 2025 11:22:50 -0700	[thread overview]
Message-ID: <aDC8-i9YQgCowJTr@linux.dev> (raw)
In-Reply-To: <87v7prdysh.wl-maz@kernel.org>

Hey,

On Fri, May 23, 2025 at 06:25:50PM +0100, Marc Zyngier wrote:
> > +int kvm_vgic_v4_unset_forwarding(struct kvm *kvm, int host_irq)
> >  {
> > -	struct vgic_its *its;
> >  	struct vgic_irq *irq;
> >  	unsigned long flags;
> >  	int ret = 0;
> > @@ -519,31 +536,19 @@ int kvm_vgic_v4_unset_forwarding(struct kvm *kvm, int virq,
> >  	if (!vgic_supports_direct_msis(kvm))
> >  		return 0;
> >  
> > -	/*
> > -	 * Get the ITS, and escape early on error (not a valid
> > -	 * doorbell for any of our vITSs).
> > -	 */
> > -	its = vgic_get_its(kvm, irq_entry);
> > -	if (IS_ERR(its))
> > +	irq = __vgic_host_irq_get_vlpi(kvm, host_irq);
> > +	if (!irq)
> >  		return 0;
> >  
> > -	mutex_lock(&its->its_lock);
> > -
> > -	ret = vgic_its_resolve_lpi(kvm, its, irq_entry->msi.devid,
> > -				   irq_entry->msi.data, &irq);
> > -	if (ret)
> > -		goto out;
> > -
> 
> Removing the reliance on the ITS locking is another thing that could
> be mentioned in the commit message, as it is slightly surprising to
> see it here, given that the previous patch is all about that.

Sure, I can add a bit of color. The prior patch left the its_lock in
place since it is still needed to walk the ITS device / ITE lists.

> My other gripe is that we lose the doorbell validation. I'm not sure
> it is a big deal, but I'd rather we keep verifying we're not being fed
> rubbish data, in case we need to rely on that in the future.

We still get doorbell validation on the set() side of things, which IMO
is where it belongs. Whether or not the MSI routing is garbage at time
of unset() isn't relevant, if we handed out a vLPI mapping we need to
kill it.

Thanks,
Oliver

  reply	other threads:[~2025-05-23 18:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-23 16:08 [PATCH 0/5] KVM: arm64: Some VGIC-related fixes Oliver Upton
2025-05-23 16:08 ` [PATCH 1/5] KVM: arm64: Use lock guard in vgic_v4_set_forwarding() Oliver Upton
2025-05-23 16:08 ` [PATCH 2/5] KVM: arm64: Protect vLPI translation with vgic_irq::irq_lock Oliver Upton
2025-05-23 16:08 ` [PATCH 3/5] KVM: arm64: Resolve vLPI by host IRQ in vgic_v4_unset_forwarding() Oliver Upton
2025-05-23 17:25   ` Marc Zyngier
2025-05-23 18:22     ` Oliver Upton [this message]
2025-05-23 16:08 ` [PATCH 4/5] KVM: arm64: Unmap vLPIs affected by changes to GSI routing information Oliver Upton
2025-05-23 17:26   ` Marc Zyngier
2025-05-23 17:48     ` Sean Christopherson
2025-05-23 18:14       ` Marc Zyngier
2025-05-23 20:54         ` Sean Christopherson
2025-05-23 20:58           ` Oliver Upton
2025-05-23 16:08 ` [PATCH 5/5] KVM: arm64: vgic-init: Plug vCPU vs. VGIC creation race Oliver Upton
2025-05-23 17:35 ` [PATCH 0/5] KVM: arm64: Some VGIC-related fixes Marc Zyngier

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=aDC8-i9YQgCowJTr@linux.dev \
    --to=oliver.upton@linux.dev \
    --cc=joey.gouly@arm.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=maz@kernel.org \
    --cc=suzuki.poulose@arm.com \
    --cc=sweettea@google.com \
    --cc=yuzenghui@huawei.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.