From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Williamson Subject: [PATCH 3/3] vfio-pci: Use common msi_get_message Date: Tue, 13 Nov 2012 12:49:17 -0700 Message-ID: <20121113194917.10446.99346.stgit@bling.home> References: <20121113194050.10446.75236.stgit@bling.home> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org To: aliguori@us.ibm.com Return-path: Received: from mx1.redhat.com ([209.132.183.28]:62872 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754329Ab2KMTtV (ORCPT ); Tue, 13 Nov 2012 14:49:21 -0500 In-Reply-To: <20121113194050.10446.75236.stgit@bling.home> Sender: kvm-owner@vger.kernel.org List-ID: We can get rid of our local version now that a helper exists. Signed-off-by: Alex Williamson --- hw/vfio_pci.c | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/hw/vfio_pci.c b/hw/vfio_pci.c index 4e9c2dd..7c27834 100644 --- a/hw/vfio_pci.c +++ b/hw/vfio_pci.c @@ -688,28 +688,6 @@ static void vfio_msix_vector_release(PCIDevice *pdev, unsigned int nr) vector->use = false; } -/* TODO This should move to msi.c */ -static MSIMessage msi_get_msg(PCIDevice *pdev, unsigned int vector) -{ - uint16_t flags = pci_get_word(pdev->config + pdev->msi_cap + PCI_MSI_FLAGS); - bool msi64bit = flags & PCI_MSI_FLAGS_64BIT; - MSIMessage msg; - - if (msi64bit) { - msg.address = pci_get_quad(pdev->config + - pdev->msi_cap + PCI_MSI_ADDRESS_LO); - } else { - msg.address = pci_get_long(pdev->config + - pdev->msi_cap + PCI_MSI_ADDRESS_LO); - } - - msg.data = pci_get_word(pdev->config + pdev->msi_cap + - (msi64bit ? PCI_MSI_DATA_64 : PCI_MSI_DATA_32)); - msg.data += vector; - - return msg; -} - static void vfio_enable_msix(VFIODevice *vdev) { vfio_disable_interrupts(vdev); @@ -748,7 +726,7 @@ retry: error_report("vfio: Error: event_notifier_init failed\n"); } - msg = msi_get_msg(&vdev->pdev, i); + msg = msi_get_message(&vdev->pdev, i); /* * Attempt to enable route through KVM irqchip,