da92986
vhost was passing a physical address to cpu_physical_memory_set_dirty,
da92986
which is wrong: we need to translate to ram address first.
da92986
da92986
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
da92986
da92986
Note: this lead to crashes during migration, so the patch
da92986
is needed on the stable branch too.
da92986
da92986
---
da92986
 hw/vhost.c |    4 +++-
da92986
 1 files changed, 3 insertions(+), 1 deletions(-)
da92986
da92986
diff --git a/hw/vhost.c b/hw/vhost.c
da92986
index aaa34e4..97a1299 100644
da92986
--- a/hw/vhost.c
da92986
+++ b/hw/vhost.c
da92986
@@ -49,8 +49,10 @@ static void vhost_dev_sync_region(struct vhost_dev *dev,
da92986
         log = __sync_fetch_and_and(from, 0);
da92986
         while ((bit = sizeof(log) > sizeof(int) ?
da92986
                 ffsll(log) : ffs(log))) {
da92986
+            ram_addr_t ram_addr;
da92986
             bit -= 1;
da92986
-            cpu_physical_memory_set_dirty(addr + bit * VHOST_LOG_PAGE);
da92986
+            ram_addr = cpu_get_physical_page_desc(addr + bit * VHOST_LOG_PAGE);
da92986
+            cpu_physical_memory_set_dirty(ram_addr);
da92986
             log &= ~(0x1ull << bit);
da92986
         }
da92986
         addr += VHOST_LOG_CHUNK;
da92986
-- 
da92986
1.7.3.2.91.g446ac
da92986