From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ney9p-0002Ls-6v for qemu-devel@nongnu.org; Tue, 09 Feb 2010 17:02:09 -0500 Received: from [199.232.76.173] (port=52488 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ney9l-0002IP-It for qemu-devel@nongnu.org; Tue, 09 Feb 2010 17:02:05 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Ney9g-0005o2-Kp for qemu-devel@nongnu.org; Tue, 09 Feb 2010 17:02:05 -0500 Received: from e7.ny.us.ibm.com ([32.97.182.137]:40037) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ney9g-0005nX-62 for qemu-devel@nongnu.org; Tue, 09 Feb 2010 17:02:00 -0500 Received: from d01relay05.pok.ibm.com (d01relay05.pok.ibm.com [9.56.227.237]) by e7.ny.us.ibm.com (8.14.3/8.13.1) with ESMTP id o19Lsqhj014829 for ; Tue, 9 Feb 2010 16:54:52 -0500 Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay05.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o19M1uAO139490 for ; Tue, 9 Feb 2010 17:01:56 -0500 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id o19M1uLe014714 for ; Tue, 9 Feb 2010 17:01:56 -0500 From: Anthony Liguori Date: Tue, 9 Feb 2010 16:01:35 -0600 Message-Id: <1265752899-26980-12-git-send-email-aliguori@us.ibm.com> In-Reply-To: <1265752899-26980-1-git-send-email-aliguori@us.ibm.com> References: <1265752899-26980-1-git-send-email-aliguori@us.ibm.com> Subject: [Qemu-devel] [PATCH 11/15] pci: add pci_register_msix_region List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Michael Tsirkin , Anthony Liguori , Alex Graf And make virtio use it. Signed-off-by: Anthony Liguori --- hw/pci.c | 8 ++++++++ hw/pci.h | 2 ++ hw/virtio-pci.c | 5 +---- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index 5460f27..50ae917 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -28,6 +28,7 @@ #include "sysemu.h" #include "loader.h" #include "qemu-objects.h" +#include "msix.h" //#define DEBUG_PCI #ifdef DEBUG_PCI @@ -823,6 +824,13 @@ void pci_register_io_region(PCIDevice *d, int region_num, } } +void pci_register_msix_region(PCIDevice *d, int region_num) +{ + pci_register_bar(d, region_num, msix_bar_size(d), + PCI_BASE_ADDRESS_SPACE_MEMORY, + msix_mmio_map); +} + static uint32_t pci_config_get_io_base(PCIDevice *d, uint32_t base, uint32_t base_upper16) { diff --git a/hw/pci.h b/hw/pci.h index 3edf28f..9645fce 100644 --- a/hw/pci.h +++ b/hw/pci.h @@ -202,6 +202,8 @@ void pci_register_io_region(PCIDevice *d, int region_num, pcibus_t size, int type, PCIIOReadFunc *readcb, PCIIOWriteFunc *writecb); +void pci_register_msix_region(PCIDevice *d, int region_num); + void pci_memory_read(PCIDevice *pci_dev, pcibus_t addr, void *buf, int len); void pci_memory_write(PCIDevice *pci_dev, pcibus_t addr, const void *buf, int len); diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index a2ba294..81c4d37 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -372,10 +372,7 @@ static void virtio_init_pci(VirtIOPCIProxy *proxy, VirtIODevice *vdev, config[0x3d] = 1; if (vdev->nvectors && !msix_init(&proxy->pci_dev, vdev->nvectors, 1, 0)) { - pci_register_bar(&proxy->pci_dev, 1, - msix_bar_size(&proxy->pci_dev), - PCI_BASE_ADDRESS_SPACE_MEMORY, - msix_mmio_map); + pci_register_msix_region(&proxy->pci_dev, 1); } else vdev->nvectors = 0; -- 1.6.5.2