From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org, anthony@codemonkey.ws
Subject: [Qemu-devel] [PATCH 2/2] virtio: do not reset msix state on soft reset
Date: Tue, 24 Nov 2009 23:31:34 +0200 [thread overview]
Message-ID: <20091124213134.GC4703@redhat.com> (raw)
In-Reply-To: <cover.1259093857.git.mst@redhat.com>
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 <mst@redhat.com>
---
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
prev parent reply other threads:[~2009-11-24 21:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1259093857.git.mst@redhat.com>
2009-11-24 21:31 ` [Qemu-devel] [PATCH 1/2] msix: add helper to mark all msix entries Michael S. Tsirkin
2009-11-24 21:31 ` Michael S. Tsirkin [this message]
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=20091124213134.GC4703@redhat.com \
--to=mst@redhat.com \
--cc=anthony@codemonkey.ws \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.