Re: [PATCH kvmtool] vfio: fix multi-MSI vector handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 24, 2020 at 02:54:37PM +0100, Marc Zyngier wrote:
> On 2020-04-24 14:40, Lorenzo Pieralisi wrote:
> > diff --git a/vfio/pci.c b/vfio/pci.c
> > index 76e24c1..b43e522 100644
> > --- a/vfio/pci.c
> > +++ b/vfio/pci.c
> > @@ -434,6 +434,12 @@ static void vfio_pci_msi_cap_write(struct kvm
> > *kvm, struct vfio_device *vdev,
> > 
> >  	for (i = 0; i < nr_vectors; i++) {
> >  		entry = &pdev->msi.entries[i];
> > +
> > +		if (nr_vectors > 1) {
> > +			msg.data &= ~(nr_vectors - 1);
> > +			msg.data |= i;
> > +		}
> > +
> 
> This matches my own understanding of how MultiMSI works.
> Small nit: you don't need to check the condition for the number
> of vectors, as this expression is valid for any nr_vectors
> that is a power of 2 (as required by the spec).
> 
> >  		entry->config.msg = msg;
> >  		vfio_pci_update_msi_entry(kvm, vdev, entry);
> >  	}
> 
> FWIW:
> 
> Acked-by: Marc Zyngier <maz@xxxxxxxxxx>

Cheers guys. Lorenzo -- if you send a new version, I can pick it up straight
away.

Will



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux