[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 14/33] virtio: generation counter support
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 14/33] virtio: generation counter support |
Date: |
Thu, 4 Jun 2015 12:34:23 +0200 |
From: "Michael S. Tsirkin" <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/virtio/virtio-pci.c | 2 +-
hw/virtio/virtio.c | 1 +
include/hw/virtio/virtio.h | 1 +
3 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 7bd31d9..c8c2b46 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -970,7 +970,7 @@ static uint64_t virtio_pci_common_read(void *opaque, hwaddr
addr,
val = vdev->status;
break;
case VIRTIO_PCI_COMMON_CFGGENERATION:
- val = 0; /* TODO */
+ val = vdev->generation;
break;
case VIRTIO_PCI_COMMON_Q_SELECT:
val = vdev->queue_sel;
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 8a6ebae..cae5eca 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -930,6 +930,7 @@ void virtio_notify_config(VirtIODevice *vdev)
return;
vdev->isr |= 0x03;
+ vdev->generation++;
virtio_notify_vector(vdev, vdev->config_vector);
}
diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
index df89913..b9e36f9 100644
--- a/include/hw/virtio/virtio.h
+++ b/include/hw/virtio/virtio.h
@@ -78,6 +78,7 @@ struct VirtIODevice
size_t config_len;
void *config;
uint16_t config_vector;
+ uint32_t generation;
int nvectors;
VirtQueue *vq;
uint16_t device_id;
--
1.8.3.1
- [Qemu-devel] [PATCH 05/33] virtio: disallow late feature changes for virtio-1, (continued)
- [Qemu-devel] [PATCH 05/33] virtio: disallow late feature changes for virtio-1, Gerd Hoffmann, 2015/06/04
- [Qemu-devel] [PATCH 01/33] virtio: 64bit features fixups., Gerd Hoffmann, 2015/06/04
- [Qemu-devel] [PATCH 09/33] virtio-net: enable virtio 1.0, Gerd Hoffmann, 2015/06/04
- [Qemu-devel] [PATCH 10/33] vhost_net: add version_1 feature, Gerd Hoffmann, 2015/06/04
- [Qemu-devel] [PATCH 03/33] virtio: allow virtio-1 queue layout, Gerd Hoffmann, 2015/06/04
- [Qemu-devel] [PATCH 02/33] virtio: endianness checks for virtio 1.0 devices, Gerd Hoffmann, 2015/06/04
- [Qemu-devel] [PATCH 17/33] virtio-pci: add flags to enable/disable legacy/modern, Gerd Hoffmann, 2015/06/04
- [Qemu-devel] [PATCH 08/33] virtio-net: support longer header, Gerd Hoffmann, 2015/06/04
- [Qemu-devel] [PATCH 15/33] virtio: add modern config accessors, Gerd Hoffmann, 2015/06/04
- [Qemu-devel] [PATCH 14/33] virtio: generation counter support,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 21/33] virtio-pci: correctly set host notifiers for modern bar, Gerd Hoffmann, 2015/06/04
- [Qemu-devel] [PATCH 16/33] virtio-pci: switch to modern accessors for 1.0, Gerd Hoffmann, 2015/06/04
- [Qemu-devel] [PATCH 11/33] vhost: 64 bit features, Gerd Hoffmann, 2015/06/04
- [Qemu-devel] [PATCH 22/33] virtio_balloon: header update, Gerd Hoffmann, 2015/06/04
- [Qemu-devel] [PATCH 19/33] virtio-pci: change & document virtio pci bar layout., Gerd Hoffmann, 2015/06/04
- [Qemu-devel] [PATCH 29/33] virtio-pci: drop identical virtio_pci_cap, Gerd Hoffmann, 2015/06/04
- [Qemu-devel] [PATCH 26/33] virtio-pci: add virtio_pci_modern_region_map(), Gerd Hoffmann, 2015/06/04
- [Qemu-devel] [PATCH 06/33] virtio: allow to fail setting status, Gerd Hoffmann, 2015/06/04
- [Qemu-devel] [PATCH 23/33] virtio-balloon: switch to virtio_add_feature, Gerd Hoffmann, 2015/06/04
- [Qemu-devel] [PATCH 20/33] virtio-pci: make modern bar 64bit + prefetchable, Gerd Hoffmann, 2015/06/04