aboutsummaryrefslogtreecommitdiffstats
path: root/main/qemu/qemu-vhost-fix-dirty-page-handling.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2011-05-04 13:29:36 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2011-05-04 13:29:36 +0000
commit0d95e358e189f366f6610cbd0bfc227b44d00826 (patch)
treeed2ec92ad737559f87c44c3c27207493fd68fbf1 /main/qemu/qemu-vhost-fix-dirty-page-handling.patch
parente5055ad583bb78dba75d943bcef5921f19e0d63d (diff)
downloadaports-0d95e358e189f366f6610cbd0bfc227b44d00826.tar.bz2
aports-0d95e358e189f366f6610cbd0bfc227b44d00826.tar.xz
main/qemu: add patch for vhost and remove unused patches
Diffstat (limited to 'main/qemu/qemu-vhost-fix-dirty-page-handling.patch')
-rw-r--r--main/qemu/qemu-vhost-fix-dirty-page-handling.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/main/qemu/qemu-vhost-fix-dirty-page-handling.patch b/main/qemu/qemu-vhost-fix-dirty-page-handling.patch
new file mode 100644
index 0000000000..e3fabb74aa
--- /dev/null
+++ b/main/qemu/qemu-vhost-fix-dirty-page-handling.patch
@@ -0,0 +1,31 @@
+vhost was passing a physical address to cpu_physical_memory_set_dirty,
+which is wrong: we need to translate to ram address first.
+
+Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
+
+Note: this lead to crashes during migration, so the patch
+is needed on the stable branch too.
+
+---
+ hw/vhost.c | 4 +++-
+ 1 files changed, 3 insertions(+), 1 deletions(-)
+
+diff --git a/hw/vhost.c b/hw/vhost.c
+index aaa34e4..97a1299 100644
+--- a/hw/vhost.c
++++ b/hw/vhost.c
+@@ -49,8 +49,10 @@ static void vhost_dev_sync_region(struct vhost_dev *dev,
+ log = __sync_fetch_and_and(from, 0);
+ while ((bit = sizeof(log) > sizeof(int) ?
+ ffsll(log) : ffs(log))) {
++ ram_addr_t ram_addr;
+ bit -= 1;
+- cpu_physical_memory_set_dirty(addr + bit * VHOST_LOG_PAGE);
++ ram_addr = cpu_get_physical_page_desc(addr + bit * VHOST_LOG_PAGE);
++ cpu_physical_memory_set_dirty(ram_addr);
+ log &= ~(0x1ull << bit);
+ }
+ addr += VHOST_LOG_CHUNK;
+--
+1.7.3.2.91.g446ac
+