qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Subject: [Qemu-devel] [PATCH] virtio-pci: Clear IRQ at reset
Date: Thu, 12 Mar 2015 14:40:55 +0800	[thread overview]
Message-ID: <1426142455-3739-1-git-send-email-famz@redhat.com> (raw)

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 <famz@redhat.com>
---
 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

             reply	other threads:[~2015-03-12  6:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-12  6:40 Fam Zheng [this message]
2015-03-12  7:22 ` [Qemu-devel] [PATCH] virtio-pci: Clear IRQ at reset Michael S. Tsirkin
2015-03-12  7:58   ` Fam Zheng
2015-03-12  9:41 ` Michael S. Tsirkin
2015-03-12 10:00   ` Fam Zheng
2015-03-12 10:06     ` Michael S. Tsirkin
2015-03-12 10:16     ` Michael S. Tsirkin
2015-03-12 10:21       ` Peter Maydell
2015-03-12 10:57         ` Michael S. Tsirkin
2015-03-12 11:04           ` Peter Maydell
2015-03-12 11:15             ` Michael S. Tsirkin
2015-03-13  6:07               ` Fam Zheng
2015-03-13  6:28                 ` Fam Zheng
2015-03-16  5:09                   ` Michael S. Tsirkin
2015-03-13 14:19                 ` Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1426142455-3739-1-git-send-email-famz@redhat.com \
    --to=famz@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).