]> git.proxmox.com Git - mirror_qemu.git/blobdiff - exec.c
exec: Handle multipage ranges in invalidate_and_set_dirty()
[mirror_qemu.git] / exec.c
diff --git a/exec.c b/exec.c
index 759055d0e38a160e3eae3ff8a25564d5d380eeaf..f0e2bd32b65ea9e581abbd78d346d943979c8267 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -2066,10 +2066,8 @@ int cpu_memory_rw_debug(CPUState *cpu, target_ulong addr,
 static void invalidate_and_set_dirty(hwaddr addr,
                                      hwaddr length)
 {
-    if (cpu_physical_memory_is_clean(addr)) {
-        /* invalidate code */
-        tb_invalidate_phys_page_range(addr, addr + length, 0);
-        /* set dirty bit */
+    if (cpu_physical_memory_range_includes_clean(addr, length)) {
+        tb_invalidate_phys_range(addr, addr + length, 0);
         cpu_physical_memory_set_dirty_range_nocode(addr, length);
     }
     xen_modified_memory(addr, length);