[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 10/26] vhost: Move log_dirty check
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 10/26] vhost: Move log_dirty check |
Date: |
Thu, 8 Feb 2018 21:09:04 +0200 |
From: "Dr. David Alan Gilbert" <address@hidden>
Move the log_dirty check into vhost_section.
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/virtio/vhost.c | 20 +++++++++++++-------
hw/virtio/trace-events | 1 +
2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 326f168..4a44e6e 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -27,6 +27,7 @@
#include "hw/virtio/virtio-access.h"
#include "migration/blocker.h"
#include "sysemu/dma.h"
+#include "trace.h"
/* enabled until disconnected backend stabilizes */
#define _VHOST_DEBUG 1
@@ -379,8 +380,19 @@ static int vhost_verify_ring_mappings(struct vhost_dev
*dev,
static bool vhost_section(MemoryRegionSection *section)
{
- return memory_region_is_ram(section->mr) &&
+ bool result;
+ bool log_dirty = memory_region_get_dirty_log_mask(section->mr) &
+ ~(1 << DIRTY_MEMORY_MIGRATION);
+ result = memory_region_is_ram(section->mr) &&
!memory_region_is_rom(section->mr);
+
+ /* Vhost doesn't handle any block which is doing dirty-tracking other
+ * than migration; this typically fires on VGA areas.
+ */
+ result &= !log_dirty;
+
+ trace_vhost_section(section->mr->name, result);
+ return result;
}
static void vhost_begin(MemoryListener *listener)
@@ -510,12 +522,6 @@ static void vhost_region_add_section(struct vhost_dev *dev,
trace_vhost_region_add_section(section->mr->name, mrs_gpa, mrs_size,
mrs_host);
- bool log_dirty = memory_region_get_dirty_log_mask(section->mr) &
- ~(1 << DIRTY_MEMORY_MIGRATION);
- if (log_dirty) {
- return;
- }
-
if (dev->n_tmp_sections) {
/* Since we already have at least one section, lets see if
* this extends it; since we're scanning in order, we only
diff --git a/hw/virtio/trace-events b/hw/virtio/trace-events
index 606e4fc..742ff0f 100644
--- a/hw/virtio/trace-events
+++ b/hw/virtio/trace-events
@@ -4,6 +4,7 @@
vhost_commit(bool started, bool changed) "Started: %d Changed: %d"
vhost_region_add_section(const char *name, uint64_t gpa, uint64_t size,
uint64_t host) "%s: 0x%"PRIx64"+0x%"PRIx64" @ 0x%"PRIx64
vhost_region_add_section_abut(const char *name, uint64_t new_size) "%s:
0x%"PRIx64
+vhost_section(const char *name, int r) "%s:%d"
# hw/virtio/virtio.c
virtqueue_alloc_element(void *elem, size_t sz, unsigned in_num, unsigned
out_num) "elem %p size %zd in_num %u out_num %u"
--
MST
- [Qemu-devel] [PULL 00/26] virtio, vhost, pci, pc: features, fixes and cleanups, Michael S. Tsirkin, 2018/02/08
- [Qemu-devel] [PULL 01/26] Revert "vhost: add traces for memory listeners", Michael S. Tsirkin, 2018/02/08
- [Qemu-devel] [PULL 04/26] vhost: Build temporary section list and deref after commit, Michael S. Tsirkin, 2018/02/08
- [Qemu-devel] [PULL 02/26] virtio: remove event notifier cleanup call on de-assign, Michael S. Tsirkin, 2018/02/08
- [Qemu-devel] [PULL 05/26] vhost: Simplify ring verification checks, Michael S. Tsirkin, 2018/02/08
- [Qemu-devel] [PULL 06/26] vhost: Merge sections added to temporary list, Michael S. Tsirkin, 2018/02/08
- [Qemu-devel] [PULL 07/26] vhost: Regenerate region list from changed sections list, Michael S. Tsirkin, 2018/02/08
- [Qemu-devel] [PULL 09/26] vhost: Merge and delete unused callbacks, Michael S. Tsirkin, 2018/02/08
- [Qemu-devel] [PULL 10/26] vhost: Move log_dirty check,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 11/26] pci-bridge/i82801b11: clear bridge registers on platform reset, Michael S. Tsirkin, 2018/02/08
- [Qemu-devel] [PULL 08/26] vhost: Clean out old vhost_set_memory and friends, Michael S. Tsirkin, 2018/02/08
- [Qemu-devel] [PULL 13/26] virtio-blk: enable multiple vectors when using multiple I/O queues, Michael S. Tsirkin, 2018/02/08
- [Qemu-devel] [PULL 12/26] pci/bus: let it has higher migration priority, Michael S. Tsirkin, 2018/02/08
- [Qemu-devel] [PULL 17/26] cryptodev-vhost-user: add crypto session handler, Michael S. Tsirkin, 2018/02/08
- [Qemu-devel] [PULL 16/26] cryptodev: add vhost support, Michael S. Tsirkin, 2018/02/08
- [Qemu-devel] [PULL 15/26] cryptodev: add vhost-user as a new cryptodev backend, Michael S. Tsirkin, 2018/02/08
- [Qemu-devel] [PULL 20/26] libvhost-user: Fix resource leak, Michael S. Tsirkin, 2018/02/08
- [Qemu-devel] [PULL 21/26] libvhost-user: Support across-memory-boundary access, Michael S. Tsirkin, 2018/02/08