From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54953) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fw6pu-0005sK-Vd for qemu-devel@nongnu.org; Sat, 01 Sep 2018 10:25:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fw6pD-00065u-Gu for qemu-devel@nongnu.org; Sat, 01 Sep 2018 10:24:32 -0400 From: Eric Auger Date: Sat, 1 Sep 2018 16:23:11 +0200 Message-Id: <20180901142312.11662-20-eric.auger@redhat.com> In-Reply-To: <20180901142312.11662-1-eric.auger@redhat.com> References: <20180901142312.11662-1-eric.auger@redhat.com> Subject: [Qemu-devel] [RFC 19/20] vfio/pci: Always set up MSI route before enabling vectors List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: eric.auger.pro@gmail.com, eric.auger@redhat.com, qemu-devel@nongnu.org, qemu-arm@nongnu.org, peter.maydell@linaro.org Cc: alex.williamson@redhat.com, mst@redhat.com, cdall@kernel.org, jean-philippe.brucker@arm.com, peterx@redhat.com, yi.l.liu@intel.com As we enable the vectors, we shall have an MSI route setup. The notification of the stage 1 binding is done on MSI route setup. Signed-off-by: Eric Auger --- hw/vfio/pci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 056f3a887a..040a2f39f8 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -522,6 +522,7 @@ static int vfio_msix_vector_do_use(PCIDevice *pdev, unsigned int nr, if (vdev->nr_vectors < nr + 1) { vfio_disable_irqindex(&vdev->vbasedev, VFIO_PCI_MSIX_IRQ_INDEX); vdev->nr_vectors = nr + 1; + vfio_add_kvm_msi_virq(vdev, vector, nr, true); ret = vfio_enable_vectors(vdev, true); if (ret) { error_report("vfio: failed to enable vectors, %d", ret); -- 2.17.1