virtio: improve virtio devices initialization time
commit6f0bb230722931d17fb284eee8efd40b9d653822
authorGal Hammer <ghammer@redhat.com>
Sun, 14 Jan 2018 10:06:56 +0000 (14 12:06 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 18 Jan 2018 19:52:38 +0000 (18 21:52 +0200)
tree197b4f2651ba4e0a42610cb50402391ea22d22fa
parent4fe6d78b2e241f41208dfb07605aace4becfc747
virtio: improve virtio devices initialization time

The loading time of a VM is quite significant when its virtio
devices use a large amount of virt-queues (e.g. a virtio-serial
device with max_ports=511). Most of the time is spend in the
creation of all the required event notifiers (ioeventfd and memory
regions).

This patch pack all the changes to the memory regions in a
single memory transaction.

Reported-by: Sitong Liu <siliu@redhat.com>
Reported-by: Xiaoling Gao <xiagao@redhat.com>
Signed-off-by: Gal Hammer <ghammer@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/virtio/virtio.c