peterdelevoryas / rpms / qemu

Forked from rpms/qemu 2 years ago
Clone

Blame qemu-vhost-fix-dirty-page-handling.patch

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