From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ND31f-0004PJ-Gn for qemu-devel@nongnu.org; Tue, 24 Nov 2009 16:34:19 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ND31a-0004Nt-CN for qemu-devel@nongnu.org; Tue, 24 Nov 2009 16:34:18 -0500 Received: from [199.232.76.173] (port=38918 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ND31a-0004Ni-6A for qemu-devel@nongnu.org; Tue, 24 Nov 2009 16:34:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36974) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1ND31Z-0001O3-Mt for qemu-devel@nongnu.org; Tue, 24 Nov 2009 16:34:13 -0500 Date: Tue, 24 Nov 2009 23:31:34 +0200 From: "Michael S. Tsirkin" Message-ID: <20091124213134.GC4703@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: [Qemu-devel] [PATCH 2/2] virtio: do not reset msix state on soft reset List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, anthony@codemonkey.ws msix state is managed by OS, not the driver, so it's wrong to touch it on io from driver Signed-off-by: Michael S. Tsirkin --- hw/virtio-pci.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index aebcf9d..d222ce0 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -185,8 +185,10 @@ static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val) break; case VIRTIO_PCI_QUEUE_PFN: pa = (target_phys_addr_t)val << VIRTIO_PCI_QUEUE_ADDR_SHIFT; - if (pa == 0) - virtio_pci_reset(&proxy->pci_dev.qdev); + if (pa == 0) { + virtio_reset(proxy->vdev); + msix_unuse_all_vectors(&proxy->pci_dev); + } else virtio_queue_set_addr(vdev, vdev->queue_sel, pa); break; @@ -199,8 +201,10 @@ static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val) break; case VIRTIO_PCI_STATUS: vdev->status = val & 0xFF; - if (vdev->status == 0) - virtio_pci_reset(&proxy->pci_dev.qdev); + if (vdev->status == 0) { + virtio_reset(proxy->vdev); + msix_unuse_all_vectors(&proxy->pci_dev); + } break; case VIRTIO_MSI_CONFIG_VECTOR: msix_vector_unuse(&proxy->pci_dev, vdev->config_vector); -- 1.6.5.2.143.g8cc62