From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53490) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJtkY-00005Z-Em for qemu-devel@nongnu.org; Thu, 04 Oct 2012 18:18:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TJtkX-0004ej-Bw for qemu-devel@nongnu.org; Thu, 04 Oct 2012 18:18:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10747) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJtkX-0004dz-4M for qemu-devel@nongnu.org; Thu, 04 Oct 2012 18:18:33 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q94MIWif001728 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 4 Oct 2012 18:18:32 -0400 From: Alex Williamson Date: Thu, 04 Oct 2012 16:18:31 -0600 Message-ID: <20121004221830.3189.73788.stgit@bling.home> In-Reply-To: <20121004220545.3189.52569.stgit@bling.home> References: <20121004220545.3189.52569.stgit@bling.home> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH 09/11] vfio-pci: Remove setting of MSI qsize List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: alex.williamson@redhat.com This was a misinterpretation of the spec, hardware doesn't get to specify how many were actually enabled through this field. Signed-off-by: Alex Williamson --- hw/vfio_pci.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/hw/vfio_pci.c b/hw/vfio_pci.c index 0ca77cf..a554e7c 100644 --- a/hw/vfio_pci.c +++ b/hw/vfio_pci.c @@ -508,20 +508,6 @@ static MSIMessage msi_get_msg(PCIDevice *pdev, unsigned int vector) return msg; } -/* So should this */ -static void msi_set_qsize(PCIDevice *pdev, uint8_t size) -{ - uint8_t *config = pdev->config + pdev->msi_cap; - uint16_t flags; - - flags = pci_get_word(config + PCI_MSI_FLAGS); - flags = le16_to_cpu(flags); - flags &= ~PCI_MSI_FLAGS_QSIZE; - flags |= (size & 0x7) << 4; - flags = cpu_to_le16(flags); - pci_set_word(config + PCI_MSI_FLAGS, flags); -} - static void vfio_enable_msix(VFIODevice *vdev) { vfio_disable_interrupts(vdev); @@ -609,8 +595,6 @@ retry: return; } - msi_set_qsize(&vdev->pdev, vdev->nr_vectors); - vdev->interrupt = VFIO_INT_MSI; DPRINTF("%s(%04x:%02x:%02x.%x) Enabled %d MSI vectors\n", __func__, @@ -671,8 +655,6 @@ static void vfio_disable_msi(VFIODevice *vdev) vfio_disable_msi_common(vdev); - msi_set_qsize(&vdev->pdev, 0); /* Actually still means 1 vector */ - DPRINTF("%s(%04x:%02x:%02x.%x)\n", __func__, vdev->host.domain, vdev->host.bus, vdev->host.slot, vdev->host.function); }