[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v3 28/32] virtio-mmio: update queue size on guest write
From: |
Michael S. Tsirkin |
Subject: |
[PULL v3 28/32] virtio-mmio: update queue size on guest write |
Date: |
Sun, 5 Jan 2020 07:59:44 -0500 |
From: Denis Plotnikov <address@hidden>
Some guests read back queue size after writing it.
Always update the on size write otherwise they might be confused.
Cc: address@hidden
Signed-off-by: Denis Plotnikov <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/virtio/virtio-mmio.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/virtio/virtio-mmio.c b/hw/virtio/virtio-mmio.c
index ef40b7a9b2..872f2cd237 100644
--- a/hw/virtio/virtio-mmio.c
+++ b/hw/virtio/virtio-mmio.c
@@ -308,8 +308,9 @@ static void virtio_mmio_write(void *opaque, hwaddr offset,
uint64_t value,
break;
case VIRTIO_MMIO_QUEUE_NUM:
trace_virtio_mmio_queue_write(value, VIRTQUEUE_MAX_SIZE);
+ virtio_queue_set_num(vdev, vdev->queue_sel, value);
+
if (proxy->legacy) {
- virtio_queue_set_num(vdev, vdev->queue_sel, value);
virtio_queue_update_rings(vdev, vdev->queue_sel);
} else {
proxy->vqs[vdev->queue_sel].num = value;
--
MST
- [PULL v3 17/32] tests/numa: Add case for QMP build HMAT, (continued)
- [PULL v3 17/32] tests/numa: Add case for QMP build HMAT, Michael S. Tsirkin, 2020/01/05
- [PULL v3 18/32] tests/bios-tables-test: add test cases for ACPI HMAT, Michael S. Tsirkin, 2020/01/05
- [PULL v3 19/32] ACPI: add expected files for HMAT tests (acpihmat), Michael S. Tsirkin, 2020/01/05
- [PULL v3 20/32] virtio-mmio: Clear v2 transport state on soft reset, Michael S. Tsirkin, 2020/01/05
- [PULL v3 21/32] hw/pci/pci_host: Remove redundant PCI_DPRINTF(), Michael S. Tsirkin, 2020/01/05
- [PULL v3 22/32] hw/pci/pci_host: Let pci_data_[read/write] use unsigned 'size' argument, Michael S. Tsirkin, 2020/01/05
- [PULL v3 23/32] vhost-user: add VHOST_USER_RESET_DEVICE to reset devices, Michael S. Tsirkin, 2020/01/05
- [PULL v3 24/32] vhost-user-scsi: reset the device if supported, Michael S. Tsirkin, 2020/01/05
- [PULL v3 25/32] hw: fix using 4.2 compat in 5.0 machine types for i440fx/q35, Michael S. Tsirkin, 2020/01/05
- [PULL v3 26/32] virtio: make seg_max virtqueue size dependent, Michael S. Tsirkin, 2020/01/05
- [PULL v3 28/32] virtio-mmio: update queue size on guest write,
Michael S. Tsirkin <=
- [PULL v3 29/32] virtio: reset region cache when on queue deletion, Michael S. Tsirkin, 2020/01/05
- [PULL v3 30/32] virtio-net: delete also control queue when TX/RX deleted, Michael S. Tsirkin, 2020/01/05
- [PULL v3 31/32] intel_iommu: a fix to vtd_find_as_from_bus_num(), Michael S. Tsirkin, 2020/01/05
- [PULL v3 32/32] intel_iommu: add present bit check for pasid table entries, Michael S. Tsirkin, 2020/01/05
- [PULL v3 27/32] tests: add virtio-scsi and virtio-blk seg_max_adjust test, Michael S. Tsirkin, 2020/01/05
- Re: [PULL v3 00/32] virtio, pci, pc: fixes, features, Peter Maydell, 2020/01/06
- [PULL v3 00/32] virtio, pci, pc: fixes, features, Michael S. Tsirkin, 2020/01/07