qemu/hw/virtio
Alexander Duyck 1a83e0b9c4 virtio-balloon: Add locking to prevent possible race when starting hinting
There is already locking in place when we are stopping free page hinting
but there is not similar protections in place when we start. I can only
assume this was overlooked as in most cases the page hinting should not be
occurring when we are starting the hinting, however there is still a chance
we could be processing hints by the time we get back around to restarting
the hinting so we are better off making sure to protect the state with the
mutex lock rather than just updating the value with no protections.

Based on feedback from Peter Maydell this issue had also been spotted by
Coverity: CID 1430269

Acked-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
Message-Id: <20200720175122.21935.78013.stgit@localhost.localdomain>
Cc: qemu-stable@nongnu.org
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2020-07-22 07:57:07 -04:00
..
Kconfig virtio-mem: Paravirtualized memory hot(un)plug 2020-07-03 07:57:04 -04:00
Makefile.objs vhost-vdpa: introduce vhost-vdpa backend 2020-07-07 07:59:51 -04:00
trace-events virtio,acpi: features, fixes, cleanups. 2020-07-07 17:37:44 +01:00
vhost-backend.c vhost-vdpa: introduce vhost-vdpa backend 2020-07-07 07:59:51 -04:00
vhost-scsi-pci.c qdev: Convert uses of qdev_set_parent_bus() with Coccinelle 2020-06-15 22:05:08 +02:00
vhost-stub.c vhost-user: simplify vhost_user_init/vhost_user_cleanup 2019-03-12 21:22:31 -04:00
vhost-user-blk-pci.c qdev: Convert uses of qdev_set_parent_bus() with Coccinelle 2020-06-15 22:05:08 +02:00
vhost-user-fs-pci.c qdev: Convert uses of qdev_set_parent_bus() with Coccinelle 2020-06-15 22:05:08 +02:00
vhost-user-fs.c qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
vhost-user-input-pci.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
vhost-user-scsi-pci.c qdev: Convert uses of qdev_set_parent_bus() with Coccinelle 2020-06-15 22:05:08 +02:00
vhost-user-vsock-pci.c qdev: Convert uses of qdev_set_parent_bus() with Coccinelle 2020-06-15 22:05:08 +02:00
vhost-user-vsock.c virtio: add vhost-user-vsock base device 2020-06-12 10:17:06 -04:00
vhost-user.c Stop vhost-user sending uninitialized mmap_offsets 2020-06-24 17:18:28 -04:00
vhost-vdpa.c vhost-vdpa: fix the compile issue without kvm 2020-07-08 06:16:48 -04:00
vhost-vsock-common.c vhost-vsock: add vhost-vsock-common abstraction 2020-06-12 10:17:06 -04:00
vhost-vsock-pci.c qdev: Convert uses of qdev_set_parent_bus() with Coccinelle 2020-06-15 22:05:08 +02:00
vhost-vsock.c vhost-vsock: add vhost-vsock-common abstraction 2020-06-12 10:17:06 -04:00
vhost.c vhost: implement vhost_force_iommu method 2020-07-03 07:57:04 -04:00
virtio-9p-pci.c qdev: Convert uses of qdev_set_parent_bus() with Coccinelle 2020-06-15 22:05:08 +02:00
virtio-balloon-pci.c qdev: Convert uses of qdev_set_parent_bus() with Coccinelle 2020-06-15 22:05:08 +02:00
virtio-balloon.c virtio-balloon: Add locking to prevent possible race when starting hinting 2020-07-22 07:57:07 -04:00
virtio-blk-pci.c qdev: Convert uses of qdev_set_parent_bus() with Coccinelle 2020-06-15 22:05:08 +02:00
virtio-bus.c virtio: notify virtqueue via host notifier when available 2019-11-06 06:35:00 -05:00
virtio-crypto-pci.c virtio: Drop broken and superfluous object_property_set_link() 2020-07-22 07:57:07 -04:00
virtio-crypto.c qom: Change object_get_canonical_path_component() not to malloc 2020-07-21 16:23:43 +02:00
virtio-input-host-pci.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
virtio-input-pci.c qdev: Convert uses of qdev_set_parent_bus() with Coccinelle 2020-06-15 22:05:08 +02:00
virtio-iommu-pci.c qom: Put name parameter before value / visitor parameter 2020-07-10 15:18:08 +02:00
virtio-iommu.c virtio-iommu: Fix coverity issue in virtio_iommu_handle_command() 2020-07-13 14:36:08 +01:00
virtio-mem-pci.c qom: Put name parameter before value / visitor parameter 2020-07-10 15:18:08 +02:00
virtio-mem-pci.h virtio-pci: Send qapi events when the virtio-mem size changes 2020-07-03 07:57:04 -04:00
virtio-mem.c qom: Change object_get_canonical_path_component() not to malloc 2020-07-21 16:23:43 +02:00
virtio-mmio.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
virtio-net-pci.c qdev: Convert uses of qdev_set_parent_bus() with Coccinelle 2020-06-15 22:05:08 +02:00
virtio-pci.c virtio-pci: implement queue_enabled method 2020-07-03 07:57:04 -04:00
virtio-pci.h virtio-pci: Add Function Level Reset support 2019-09-04 06:33:10 -04:00
virtio-pmem-pci.c qom: Put name parameter before value / visitor parameter 2020-07-10 15:18:08 +02:00
virtio-pmem-pci.h virtio-pci: Proxy for virtio-pmem 2019-07-04 17:00:32 -04:00
virtio-pmem.c qom: Change object_get_canonical_path_component() not to malloc 2020-07-21 16:23:43 +02:00
virtio-rng-pci.c virtio: Drop broken and superfluous object_property_set_link() 2020-07-22 07:57:07 -04:00
virtio-rng.c error: Eliminate error_propagate() with Coccinelle, part 1 2020-07-10 15:18:08 +02:00
virtio-scsi-pci.c qdev: Convert uses of qdev_set_parent_bus() with Coccinelle 2020-06-15 22:05:08 +02:00
virtio-serial-pci.c qdev: Convert uses of qdev_set_parent_bus() with Coccinelle 2020-06-15 22:05:08 +02:00
virtio.c virtio-bus: introduce queue_enabled method 2020-07-03 07:57:04 -04:00