qemu-patch-raspberry4/hw/virtio
Prerna Saxena 28ed5ef163 vhost-user: Attempt to fix a race with set_mem_table.
The set_mem_table command currently does not seek a reply. Hence, there is
no easy way for a remote application to notify to QEMU when it finished
setting up memory, or if there were errors doing so.

As an example:
(1) Qemu sends a SET_MEM_TABLE to the backend (eg, a vhost-user net
application). SET_MEM_TABLE does not require a reply according to the spec.
(2) Qemu commits the memory to the guest.
(3) Guest issues an I/O operation over a new memory region which was configured on (1).
(4) The application has not yet remapped the memory, but it sees the I/O request.
(5) The application cannot satisfy the request because it does not know about those GPAs.

While a guaranteed fix would require a protocol extension (committed separately),
a best-effort workaround for existing applications is to send a GET_FEATURES
message before completing the vhost_user_set_mem_table() call.
Since GET_FEATURES requires a reply, an application that processes vhost-user
messages synchronously would probably have completed the SET_MEM_TABLE before replying.

Signed-off-by: Prerna Saxena <prerna.saxena@nutanix.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2016-08-10 17:47:29 +03:00
..
Makefile.objs vring: remove 2016-02-25 13:14:19 +02:00
trace-events trace: split out trace events for hw/virtio/ directory 2016-06-20 17:22:15 +01:00
vhost-backend.c Use #include "..." for our own headers, <...> for others 2016-07-12 16:19:16 +02:00
vhost-user.c vhost-user: Attempt to fix a race with set_mem_table. 2016-08-10 17:47:29 +03:00
vhost.c vhost: do not update last avail idx on get_vring_base() failure 2016-07-29 05:47:17 +03:00
virtio-balloon.c virtio-balloon: Wrap in vmstate 2016-07-21 20:44:20 +03:00
virtio-bus.c virtio: revert host notifiers to old semantics 2016-07-04 14:52:10 +03:00
virtio-mmio.c virtio-mmio: format transport base address in BusClass.get_dev_path 2016-07-14 16:51:36 +01:00
virtio-pci.c hw/virtio-pci: fix virtio behaviour 2016-07-29 00:07:10 +03:00
virtio-pci.h hw/virtio-pci: fix virtio behaviour 2016-07-29 00:07:10 +03:00
virtio-rng.c virtio-rng: Wrap in vmstate 2016-07-21 20:44:20 +03:00
virtio.c pc, pci, virtio: cleanups, fixes 2016-07-29 11:57:01 +01:00