Received: from eggs.gnu.org ([2001:4830:134:3::10]:45004) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVwnt-0008HK-HL for qemu-devel@nongnu.org; Thu, 12 Mar 2015 02:41:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YVwnp-0002oj-5y for qemu-devel@nongnu.org; Thu, 12 Mar 2015 02:41:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40889) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVwno-0002oU-Uf for qemu-devel@nongnu.org; Thu, 12 Mar 2015 02:41:05 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t2C6f20s024465 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 12 Mar 2015 02:41:02 -0400 From: Fam Zheng Date: Thu, 12 Mar 2015 14:40:55 +0800 Message-Id: <1426142455-3739-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH] virtio-pci: Clear IRQ at reset List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" Currently we could leave PCI IRQ asserted even after reset, it is safer to clear it. In the case that a buggy driver has disabled MSI-X unintentially, we may have already injected IRQ in previous virtio_pci_notify, which will not be cleared by guest because it doesn't expect it (i.e. no irq handler). However the driver may eventually notice the unresponsiveness and reset the device, at that point, clearing the irq is meaningful. Signed-off-by: Fam Zheng --- hw/virtio/virtio-pci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index e7baf7b..2600f1e 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -988,6 +988,7 @@ static void virtio_pci_reset(DeviceState *qdev) virtio_pci_stop_ioeventfd(proxy); virtio_bus_reset(bus); msix_unuse_all_vectors(&proxy->pci_dev); + pci_irq_deassert(&proxy->pci_dev); } static Property virtio_pci_properties[] = { -- 1.9.3