[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] xen: xen_sync_dirty_bitmap: attempt to fix SEGV



When xc_hvm_track_dirty_vram fails, iterate through pages based on
vram_offset and npages, rather than start_addr and size. DPRINTF
before the loop in the hope of seeing output before SEGV.

Signed-off-by: Alex Bligh <alex@xxxxxxxxxxx>
---
 xen-all.c |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/xen-all.c b/xen-all.c
index dbd759c..96a34a9 100644
--- a/xen-all.c
+++ b/xen-all.c
@@ -472,18 +472,17 @@ static int xen_sync_dirty_bitmap(XenIOState *state,
                                  bitmap);
     if (rc < 0) {
         if (rc != -ENODATA) {
-            ram_addr_t addr, end;
-
-            xen_modified_memory(start_addr, size);
-            
-            end = TARGET_PAGE_ALIGN(start_addr + size);
-            for (addr = start_addr & TARGET_PAGE_MASK; addr < end; addr += 
TARGET_PAGE_SIZE) {
-                cpu_physical_memory_set_dirty(addr);
-            }
+            target_phys_addr_t todirty;
 
             DPRINTF("xen: track_dirty_vram failed (0x" TARGET_FMT_plx
                     ", 0x" TARGET_FMT_plx "): %s\n",
                     start_addr, start_addr + size, strerror(-rc));
+
+            xen_modified_memory(vram_offset, npages * TARGET_PAGE_SIZE);
+
+            for (todirty = vram_offset, i=0; i < npages; todirty += 
TARGET_PAGE_SIZE, i++) {
+                cpu_physical_memory_set_dirty(todirty);
+            }
         }
         return rc;
     }
-- 
1.7.4.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.