[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 04/12] vhost: Don't merge unmergeable memory sections
From: |
David Hildenbrand |
Subject: |
[PATCH v1 04/12] vhost: Don't merge unmergeable memory sections |
Date: |
Wed, 27 Oct 2021 14:45:23 +0200 |
Memory sections that are marked unmergeable should not be merged, to
allow for atomic removal later.
Signed-off-by: David Hildenbrand <david@redhat.com>
---
hw/virtio/vhost.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 2707972870..49a1074097 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -620,7 +620,7 @@ static void vhost_region_add_section(struct vhost_dev *dev,
mrs_size, mrs_host);
}
- if (dev->n_tmp_sections) {
+ if (dev->n_tmp_sections && !section->unmergeable) {
/* Since we already have at least one section, lets see if
* this extends it; since we're scanning in order, we only
* have to look at the last one, and the FlatView that calls
@@ -653,7 +653,7 @@ static void vhost_region_add_section(struct vhost_dev *dev,
size_t offset = mrs_gpa - prev_gpa_start;
if (prev_host_start + offset == mrs_host &&
- section->mr == prev_sec->mr &&
+ section->mr == prev_sec->mr && !prev_sec->unmergeable &&
(!dev->vhost_ops->vhost_backend_can_merge ||
dev->vhost_ops->vhost_backend_can_merge(dev,
mrs_host, mrs_size,
--
2.31.1
- [PATCH v1 00/12] virtio-mem: Expose device memory via multiple memslots, David Hildenbrand, 2021/10/27
- [PATCH v1 01/12] kvm: Return number of free memslots, David Hildenbrand, 2021/10/27
- [PATCH v1 04/12] vhost: Don't merge unmergeable memory sections,
David Hildenbrand <=
- [PATCH v1 03/12] memory: Allow for marking memory region aliases unmergeable, David Hildenbrand, 2021/10/27
- [PATCH v1 02/12] vhost: Return number of free memslots, David Hildenbrand, 2021/10/27
- Re: [PATCH v1 02/12] vhost: Return number of free memslots, Philippe Mathieu-Daudé, 2021/10/27
- Re: [PATCH v1 02/12] vhost: Return number of free memslots, David Hildenbrand, 2021/10/27
- Re: [PATCH v1 02/12] vhost: Return number of free memslots, David Hildenbrand, 2021/10/27
- Re: [PATCH v1 02/12] vhost: Return number of free memslots, Philippe Mathieu-Daudé, 2021/10/27
- Re: [PATCH v1 02/12] vhost: Return number of free memslots, Michael S. Tsirkin, 2021/10/27
- Re: [PATCH v1 02/12] vhost: Return number of free memslots, David Hildenbrand, 2021/10/27
- Re: [PATCH v1 02/12] vhost: Return number of free memslots, Philippe Mathieu-Daudé, 2021/10/27
- Re: [PATCH v1 02/12] vhost: Return number of free memslots, David Hildenbrand, 2021/10/27