[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 25/29] vhost-user: fix duplicated notifier MR init
From: |
Michael S. Tsirkin |
Subject: |
[PULL 25/29] vhost-user: fix duplicated notifier MR init |
Date: |
Tue, 19 Oct 2021 07:20:51 -0400 |
From: Xueming Li <xuemingl@nvidia.com>
In case of device resume after suspend, VQ notifier MR still valid.
Duplicated registrations explode memory block list and slow down device
resume.
Fixes: 44866521bd6e ("vhost-user: support registering external host notifiers")
Cc: tiwei.bie@intel.com
Cc: qemu-stable@nongnu.org
Cc: Yuwei Zhang <zhangyuwei.9149@bytedance.com>
Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Message-Id: <20211008080215.590292-1-xuemingl@nvidia.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/virtio/vhost-user.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
index 2c8556237f..bf6e50223c 100644
--- a/hw/virtio/vhost-user.c
+++ b/hw/virtio/vhost-user.c
@@ -1526,8 +1526,9 @@ static int
vhost_user_slave_handle_vring_host_notifier(struct vhost_dev *dev,
name = g_strdup_printf("vhost-user/host-notifier@%p mmaps[%d]",
user, queue_idx);
- memory_region_init_ram_device_ptr(&n->mr, OBJECT(vdev), name,
- page_size, addr);
+ if (!n->mr.ram) /* Don't init again after suspend. */
+ memory_region_init_ram_device_ptr(&n->mr, OBJECT(vdev), name,
+ page_size, addr);
g_free(name);
if (virtio_queue_set_host_notifier_mr(vdev, queue_idx, &n->mr, true)) {
--
MST
- [PULL 14/29] tests: migration-test: use qtest_has_accel() API, (continued)
- [PULL 14/29] tests: migration-test: use qtest_has_accel() API, Michael S. Tsirkin, 2021/10/19
- [PULL 24/29] docs: Add documentation for vhost based RNG implementation, Michael S. Tsirkin, 2021/10/19
- [PULL 05/29] tests: acpi: update expected tables blobs, Michael S. Tsirkin, 2021/10/19
- [PULL 12/29] tests: acpi: arm/virt: drop redundant test_acpi_one() in test_acpi_virt_tcg(), Michael S. Tsirkin, 2021/10/19
- [PULL 17/29] vdpa: Add vhost_vdpa_section_end, Michael S. Tsirkin, 2021/10/19
- [PULL 16/29] vdpa: Skip protected ram IOMMU mappings, Michael S. Tsirkin, 2021/10/19
- [PULL 18/29] vdpa: Check for iova range at mappings changes, Michael S. Tsirkin, 2021/10/19
- [PULL 20/29] virtio-iommu: Drop base_name and change generic_name, Michael S. Tsirkin, 2021/10/19
- [PULL 23/29] vhost-user-rng-pci: Add vhost-user-rng-pci implementation, Michael S. Tsirkin, 2021/10/19
- [PULL 22/29] vhost-user-rng: Add vhost-user-rng implementation, Michael S. Tsirkin, 2021/10/19
- [PULL 25/29] vhost-user: fix duplicated notifier MR init,
Michael S. Tsirkin <=
- [PULL 26/29] tests/acpi/bios-tables-test: add and allow changes to a new q35 DSDT table blob, Michael S. Tsirkin, 2021/10/19
- [PULL 27/29] tests/acpi/pcihp: add unit tests for hotplug on multifunction bridges for q35, Michael S. Tsirkin, 2021/10/19
- [PULL 28/29] tests/acpi/bios-tables-test: update DSDT blob for multifunction bridge test, Michael S. Tsirkin, 2021/10/19
- [PULL 29/29] failover: fix a regression introduced by JSON'ification of -device, Michael S. Tsirkin, 2021/10/19
- [PULL 15/29] tests: bios-tables-test: use qtest_has_accel() API to register TCG only tests, Michael S. Tsirkin, 2021/10/19
- [PULL 10/29] tests: acpi: add testcase for amd-iommu (IVRS table), Michael S. Tsirkin, 2021/10/19
- Re: [PULL 00/29] pc,pci,virtio: features, fixes, Michael S. Tsirkin, 2021/10/19
- [PULL 30/29] vhost-user-blk-test: pass vhost-user socket fds to QSD, Michael S. Tsirkin, 2021/10/19
- Re: [PULL 00/29] pc,pci,virtio: features, fixes, Richard Henderson, 2021/10/19