From patchwork Tue Nov 13 19:49:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Williamson X-Patchwork-Id: 198759 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A12EB2C0079 for ; Wed, 14 Nov 2012 06:49:36 +1100 (EST) Received: from localhost ([::1]:34090 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYMUI-0000Mc-Sh for incoming@patchwork.ozlabs.org; Tue, 13 Nov 2012 14:49:34 -0500 Received: from eggs.gnu.org ([208.118.235.92]:38112) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYMU6-0000A8-BM for qemu-devel@nongnu.org; Tue, 13 Nov 2012 14:49:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TYMU3-0004rb-8v for qemu-devel@nongnu.org; Tue, 13 Nov 2012 14:49:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:2491) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYMU3-0004rR-18 for qemu-devel@nongnu.org; Tue, 13 Nov 2012 14:49:19 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qADJnIXx029269 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 13 Nov 2012 14:49:18 -0500 Received: from bling.home (ovpn-113-59.phx2.redhat.com [10.3.113.59]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qADJnHAg015049; Tue, 13 Nov 2012 14:49:17 -0500 To: aliguori@us.ibm.com From: Alex Williamson Date: Tue, 13 Nov 2012 12:49:17 -0700 Message-ID: <20121113194917.10446.99346.stgit@bling.home> In-Reply-To: <20121113194050.10446.75236.stgit@bling.home> References: <20121113194050.10446.75236.stgit@bling.home> User-Agent: StGit/0.16 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: [Qemu-devel] [PATCH 3/3] vfio-pci: Use common msi_get_message X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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,